一行,3科成绩,用空格分隔,范围(0~100)。
一行,把3科成绩显示出来,输出格式详见输出样例。
60 80 90
score1=60,score2=80,score3=90
#include <stdio.h> int main() { int arr[3]; scanf("%hd %hd %hd\n",&arr[0],&arr[1],&arr[2]); for(int i=1;i<4;i++) { printf("score%hd=%hd",i,arr[i-1]); if(i<3) printf(","); } return 0; }
#include <stdio.h> int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); printf("score1=%d,score2=%d,score3=%d\n", a, b, c); return 0; }
#include <stdio.h> int main(){ int a = 0; int b = 0; int c = 0; scanf("%d %d %d", &a, &b, &c); printf("score1=%d,score2=%d,score3=%d",a,b,c); return 0; }
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题