谁帮忙写一个C语言小程序

[复制链接]
查看11 | 回复5 | 2009-8-13 21:43:53 | 显示全部楼层 |阅读模式
#includeint main(){ int a,b; char c; printf("请输入第一个数:"); fflush(stdin); scanf("%d",&a); printf("请输入第二个数:"); scanf("%d",&b); printf("请输入运算符:"); fflush(stdin); scanf("%c",&c);//接收用户输入的运算符 switch (c) { case '+':printf("a+b=%d",a+b);break; case '-':printf("a-b=%d",a-b);break...
回复

使用道具 举报

千问 | 2009-8-13 21:43:53 | 显示全部楼层
给,已经编译运行确认:#include#includeint main() { int data1,data2; char op; printf("please input the data and the operator like this :a+b \n"); scanf("%...
回复

使用道具 举报

千问 | 2009-8-13 21:43:53 | 显示全部楼层
#include main(){int data1,data2;char op;scanf("%d%c%d",&data1,&op,&data2);switch(op){
case +:
printf("%d",data1+data2);
break;
...
回复

使用道具 举报

千问 | 2009-8-13 21:43:53 | 显示全部楼层
#includemain(){float data1,data2;char op,c;printf("Input your first number:\n");scanf("%f",&data1);printf("Input your second number:\n");scanf("%f",&data2)...
回复

使用道具 举报

千问 | 2009-8-13 21:43:53 | 显示全部楼层
#include#include#includechar buffer[1024],ch[1024],opr;int index=0,buf=0;int op1,op2;bool hasOne=false;void getDigit();void getOpr(...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行