public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
if(num >= 10){
for(int i = 1;i <= 10;i++)
{
if(num / 10 < 10){
count++;
break;
}else{
num /= 10;
count++;
}
}
}
count++;
System.out.println("它是个" + count + "位的数!");
}
}
public static void main(String[] args){
int num = 999;
int count = 0;
if(num >= 10){
for(int i = 1;i <= 10;i++)
{
if(num / 10 < 10){
count++;
break;
}else{
num /= 10;
count++;
}
}
}
count++;
System.out.println("它是个" + count + "位的数!");
}
}
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
if(num >= 10){
for(int i = 1;i <= 10;i++)
{
if(num / 10 < 10){
count++;
break;
}else{
num /= 10;
count++;
}
}
}
count++;
System.out.println("它是个" + count + "位的数!");
}
}
public static void main(String[] args){
int num = 999;
int count = 0;
if(num >= 10){
for(int i = 1;i <= 10;i++)
{
if(num / 10 < 10){
count++;
break;
}else{
num /= 10;
count++;
}
}
}
count++;
System.out.println("它是个" + count + "位的数!");
}
}
public class HelloWorld{
public static void main(String[] args) {
final String SEX1="男";
final String SEX2="女";
System.out.println("张三性别:"+SEX1);
System.out.println("小丽性别:"+SEX2);
}
}
public static void main(String[] args) {
final String SEX1="男";
final String SEX2="女";
System.out.println("张三性别:"+SEX1);
System.out.println("小丽性别:"+SEX2);
}
}
2015-07-31