public class Shenweiqi{
public static void main(String[] args){
int sum=0;
for(int i=1;i<=10;i++){
sum=i+sum;
if(sum>20){
System.out.println(sum);
break;
}
}
}
}
public static void main(String[] args){
int sum=0;
for(int i=1;i<=10;i++){
sum=i+sum;
if(sum>20){
System.out.println(sum);
break;
}
}
}
}
2015-08-16
int[] ages={18,23,21,19,25,29,17};
int max=18;
for(int i=0;i<ages.length;i++){
while(max<ages[i]){
max=ages[i];
}
int max=18;
for(int i=0;i<ages.length;i++){
while(max<ages[i]){
max=ages[i];
}
2015-08-16
int[] ages={18,23,21,19,25,29,17};
int max=18;
for(int i=0;i<ages.length;i++){
while(max<ages[i]){
max=ages[i];
int max=18;
for(int i=0;i<ages.length;i++){
while(max<ages[i]){
max=ages[i];
2015-08-16
System.out.println("加分前成绩:"+score);
for(;score<60;score++){
count= count+1;
}
System.out.println("加分后成绩:"+score);
System.out.println("共加了"+count+"次!");
for(;score<60;score++){
count= count+1;
}
System.out.println("加分后成绩:"+score);
System.out.println("共加了"+count+"次!");
int num = 999;
int count = 0;
for(;num>1;){
num = num/10;
count=count+1;
}
System.out.println("它是个"+count+"位的数!");
int count = 0;
for(;num>1;){
num = num/10;
count=count+1;
}
System.out.println("它是个"+count+"位的数!");
for(int j;max<nums[i];){
j=nums[i];
max=j;
}
for(int h;min>nums[i];){
h=nums[i];
min=h;
}
sum+=nums[i];
}
avg=sum/nums.length;
j=nums[i];
max=j;
}
for(int h;min>nums[i];){
h=nums[i];
min=h;
}
sum+=nums[i];
}
avg=sum/nums.length;
public class HelloWorld{
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
int avg2=(int)avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
应该也可以吧
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
int avg2=(int)avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
应该也可以吧
2015-08-16