首页 > 试题广场 >

成绩输入输出

[编程题]成绩输入输出
  • 热度指数:105662 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 256M,其他语言512M
  • 算法知识视频讲解
\hspace{15pt}输入三科成绩 a,b,c,按照 \texttt{ 的格式,把三科成绩输出。

输入描述:
\hspace{15pt}在一行上输入三个整数 a,b,c \left(0 \leq a,b,c \leq 100 \right),表示三科成绩,用空格分隔。


输出描述:
\hspace{15pt}在一行上输出格式化后的三科成绩,您可以查看样例得到更具体的说明。
示例1

输入

60 80 90

输出

score1=60,score2=80,score3=90

备注:
本题已于下方时间节点更新,请注意题解时效性:
1. 2025-10-24 优化题面文本与格式。
头像 只是小龙而已
发表于 2022-09-28 09:37:39
讲解scanf小知识,这题需要注意一下scanf函数使用的一个小细节。[喝可乐] 输入描述: 一行,3科成绩,用空格分隔,范围(0~100)。 题目里面有这样的输入描述,重点注意其中的“用空格分隔”。 对于scanf函数来说,第一个 展开全文
头像 牛客193971283号
发表于 2022-04-06 17:42:05
#include <stdio.h> int main() { int a = 0; int b = 0; int c = 0; scan: scanf("%d %d %d",&a,&b,&c); if (a &l 展开全文
头像 起名字太难了吧
发表于 2021-09-20 20:04:18
#include<stdio.h> int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); printf("score1=%d,score2=%d,score3=%d 展开全文
头像 牛客645304895号
发表于 2022-04-04 21:34:18
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //用数组存放这三科的成绩 int[] 展开全文
头像 TTNTO
发表于 2022-02-08 16:37:32
goals = list(input().split(' ')) print('score1={},score2={},score3={}'.format(goals[0],goals[1],goals[2]))
头像 Albert_weiku
发表于 2021-10-15 10:21:46
#include<iostream> using namespace std; int main() { int a,b,c;//在题目定数量的情况下,直接设置变量是最简单的 cin>>a>>b>>c;//cin可以识别空格和换行键 展开全文
头像 NEWZGG
发表于 2020-08-23 16:50:49
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scanner =new Scanner(System.in); String str =scanner. 展开全文
头像 云梦士
发表于 2021-10-09 16:25:56
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String 展开全文
头像 牛客392944813号
发表于 2022-03-17 11:50:36
#include<stdio.h> int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a<=100&&a>=0&&b<=100&&b>= 展开全文
头像 牛客题解官
发表于 2020-06-04 17:02:44
分析: 本题考查基本的流读取函数scanf,cin等方法的使用 解法1: 使用scanf读取控制台输入 #include <bits/stdc++.h> using namespace std; int main() { int score1 = 0, score2 = 0, 展开全文

问题信息

上传者:牛客309119号
难度:
207条回答 4130浏览

热门推荐

通过挑战的用户

查看代码
成绩输入输出