求求代码啊
判断字母大小写,并将大写转化成小写
判断字母大小写,并将大写转化成小写
2016-05-21
public class HelloWorld {
public static void main(String[] args) {
// 变量保存成绩
int score = 53;
// 变量保存加分次数
int count = 0;
//打印输出加分前成绩
System.out.println("加分前成绩:"+score);
// 只要成绩小于60,就循环执行加分操作,并统计加分次数
if(score<60){while(score!=0){
score=score+1
count++
}
System.out.println("加分后成绩:"+score)
System.out.println("共加了"+count+"次!")
}
package www.java.com;
import java.util.Scanner;
public class Test
{
public static void main(String[] args)
{
int classNum=3;
int stuNum=4;
double sum =0;
double avg=0;
Scanner input =new Scanner(System.in);
System.out.println("请输入学生成绩");
for (int i = 1; i <=classNum; i++)
{
sum=0;
System.out.println("*****请输入第"+i+"个班级的成绩");
for (int j = 1; j < stuNum; j++)
{
System.out.println("请输入第"+j+"个学生的成绩");
int score=input.nextInt();
sum =sum+score;
}
avg=sum/stuNum;
System.out.println("平均分为"+avg);
}
int score =input.nextInt();
}
}
举报