编程,编程

来源:百度知道 编辑:UC知道 时间:2024/05/30 17:30:14
从键盘中输入三个整数a,b,x,判断x是否等于a,b之和.
晕!我本就不会!给我讲哈!求你们了!速度!

#include<stdio.h>
void main()
{ int a,b,x;
printf("请输入a b x:");
scanf("%d%d%d",&a,&b,&x);
if(a+b==x)
printf("a+b=x");
else
printf("a+b!=x");
}

我怀疑你的能力.

好好看书吧,不是说你,你再菜,这种问题也不该拿来问的...好好看书才是王道!

using namespace std;
#include <iostream>
int main(){
int a,b,c,x;
cout<<"input a:"<<endl;
cin>>a;
cout<<"input b:"<<endl;
cin>>b;
cout<<"input x:"<<endl;
cin>>x;
c = a+b;
if(c==x){
cout<<"a+b的和等于x.";
}else{
cout<<"a+b的和不等于x.";
}
return 0;
}

注:本人从来都不打击初学者,因为我曾经也是这么过来的。