例如,ACM 有一道题,要求写出输入两个数,输出这两数之和的程序。它说:
Sample Input
1 5
Sample Output
6
就是举例,当输入1 5 ,则输出 6
Sample C++ 程序:
#include <iostream>
int main()
{
int a,b
while(cin >>a >>b)
cout <<a+b <<endl
}
Sample C 程序:
#include <stdio.h>
int main()
{
int a,b
while(scanf("%d %d",&a, &b) != EOF)
printf("%d\n",a+b)
}
题目没给全吧这两个sample input可以有很多种输出
根据你给的信息只能确定 如果运算符的数量小于数字数量-1时会打印出error
其他的什么信息都确定不了 你把你题目放全了再说