2012年C语言练习题.docVIP

  • 219
  • 0
  • 约6.93千字
  • 约 9页
  • 2017-01-03 发布于北京
  • 举报
第四天的编程题 利用简单分支选择语句判断输入的一个整数是否是偶数Int num; Printf(“%s”,”please enter valid number.”); Scanf(“%d”,num) If (num %2 == 0) { Printf(“%s”,”you already enter valid number.”) } else { Printf(“%s”,”you enter is not valid number.”) } // query:如果用户输入的是一个字符串,程序将会发生什么事? 2.编写一个程序,要求从键盘上输入某个学生的四科成绩,求出该学生的最高分和最低分 printf(请输入某个学生的四科成绩,并用逗号隔开\n);“%d%d%d%d”, chineseScore, mathScore. englishScore); int maxScore,minScore; maxScore=minScore= chineseScore; /* calculate reconciled maxScore*/ if (maxScore historyScore) { maxScore = historyScore; } If (maxScore mathScore) { maxScore = mathScore; } If

文档评论(0)

1亿VIP精品文档

相关文档