没有合适的资源?快使用搜索试试~ 我知道了~
好玩东东叫四则运算真的
需积分: 7 1 下载量 98 浏览量
2011-05-26
19:25:05
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
好玩东东叫四则运算真的好玩东东叫四则运算真的
资源推荐
资源详情
资源评论
#include <math.h>
#include <stdio.h>
main()
{
float num1,num2,result;
char fuhao,answer;
int right;
clrscr();/*清平*/
printf("*********welcome to lin er ming's system*********");
printf("\n");
do
{
printf("please enter num1,fuhao,num2:");
scanf("%f,%c,%f",&num1,&fuhao,&num2);/*可以修改输入,会更好*/
/*scanf("%c",&fuhao);
scanf("%f",&num2);*//*可以修改输入,会更好*/
printf("please enter your answer:");
scanf("%f",&result);
switch(fuhao)
{
case '+':if(result==(num1+num2)) right=1;
else
right=0;
break;
case '-':if(result==(num1-num2)) right=1;
else
right=0;
break;
#include <stdio.h>
main()
{
float num1,num2,result;
char fuhao,answer;
int right;
clrscr();/*清平*/
printf("*********welcome to lin er ming's system*********");
printf("\n");
do
{
printf("please enter num1,fuhao,num2:");
scanf("%f,%c,%f",&num1,&fuhao,&num2);/*可以修改输入,会更好*/
/*scanf("%c",&fuhao);
scanf("%f",&num2);*//*可以修改输入,会更好*/
printf("please enter your answer:");
scanf("%f",&result);
switch(fuhao)
{
case '+':if(result==(num1+num2)) right=1;
else
right=0;
break;
case '-':if(result==(num1-num2)) right=1;
else
right=0;
break;
资源评论
benben19871987
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功