我写的它报错,导生布置的写不来啊。这个是c语言写的,昨晚上该提交,可惜四个timu只交了一个。如下:
a,b直接赋值改为输入赋值
scanf("%d %d", &a,&b);
C不怎么会 , 你写的那个应该是没有判断,a和b的值 人家有限制的。
如果是java的话,你看下是不是满足你的需求
C语言
#include <stdio.h>
#include <stdlib.h>
int main(void){
int a, b, c;
scanf("%d%d", &a, &b);
c = a + b;
printf("%d\n", c);
system("pause") ;
return 0;
}
C++
#include <iostream>
using namespace std;
int main(void){
int a, b, c;
cin >> a >> b;
c = a + b;
cout << c << endl;
system("pause") ;
return 0;
}