这是时间戳和像素平均值的编码。如何将时间戳值和平均值相乘?
时间戳编码:
public class GetTimeStamp {
public static void main(String[] args) {
java.util.Date time = new java.util.Date();
System.out.println(new java.sql.Time(time.getTime()));
}
}
为Avarage编码:
class Average1 {
public static void main (String args[]){
int one = 256789;
int two = 10;
int three = one % two;
System.out.println(" Average In 6 Digit ");
System.out.println(" " + three);
int four = 25678;
int five = 10;
int six = four % five;
System.out.println(" " + six);
int seven = 2567;
int eight = 10;
int nine = seven % eight;
System.out.println(" " + nine);
int ten = 256;
int eleven = 10;
int twelve = ten % eleven;
System.out.println(" " + twelve);
int a = 25;
int b = 10;
int c = a % b;
System.out.println(" " + c);
int d = 2;
int e = 10;
int f = d % e;
System.out.println(" " + f);
}
}
答案 0 :(得分:0)
在“平均代码”示例中,您使用的是%
,即模数,您需要使用/
作为分区。
int first = 30;
int second = 10;
int average = first / second;;
System.out.println( average );
除此之外,我不明白你在问什么。