課程
/后端開發(fā)
/Java
/Java入門第一季(IDEA工具)升級版
判斷字母大小寫,并將大寫轉化成小寫
2016-05-21
源自:Java入門第一季(IDEA工具)升級版 5-1
正在回答
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ??
? ? ? ? // 變量保存成績
? ? ? ? int score = 53;?
? ? ? ? // 變量保存加分次數(shù)
? ? ? ? int count = 0;
? ? ? ? //打印輸出加分前成績?
? ? ? ? ?System.out.println("加分前成績:"+score);?
? ? ? ?
? ? ? ? // 只要成績小于60,就循環(huán)執(zhí)行加分操作,并統(tǒng)計加分次數(shù)
? ? ? ? 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();??}}
舉報
0基礎萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎語法開始
3 回答求大神幫忙看看代碼啊!
5 回答代碼求救。
1 回答求問大神,代碼求解
2 回答錯誤代碼,求問
4 回答代碼問題求解??!
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2016-05-22
public class HelloWorld {
? ? public static void main(String[] args) {
? ? ? ??
? ? ? ? // 變量保存成績
? ? ? ? int score = 53;?
? ? ? ??
? ? ? ? // 變量保存加分次數(shù)
? ? ? ? int count = 0;
? ? ? ? //打印輸出加分前成績?
? ? ? ? ?System.out.println("加分前成績:"+score);?
? ? ? ?
? ? ? ??
? ? ? ? // 只要成績小于60,就循環(huán)執(zhí)行加分操作,并統(tǒng)計加分次數(shù)
? ? ? ? if(score<60){while(score!=0){
? ? ? ? ? ? score=score+1
? ? ? ? ? ? count++
? ? ? ? }
? ? ? ? System.out.println("加分后成績:"+score)
? ? ? ? System.out.println("共加了"+count+"次!")
? ? ? ??
? ? ? ? }
? ? ? ??
2016-05-21
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();
??
}
}