public class HelloWorld {
public static void main(String[] args) {
int m = 5;
int n = 7;
int x = (m+n)%(n+1);
System.out.println("m:" + m);
System.out.println("n:" + n);
System.out.println("x:" + x);
}
}
public static void main(String[] args) {
int m = 5;
int n = 7;
int x = (m+n)%(n+1);
System.out.println("m:" + m);
System.out.println("n:" + n);
System.out.println("x:" + x);
}
}
2015-07-14
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
do
{
num=num/10;
count++;
}while(num!=0);
System.out.println("它是个"+count+"位的数!");
}
}
public static void main(String[] args){
int num = 999;
int count = 0;
do
{
num=num/10;
count++;
}while(num!=0);
System.out.println("它是个"+count+"位的数!");
}
}