从键盘上输入两个整数_由用户回答它们的和_差_积_商和取余运算结果_并统计出正确答案的个数
来源:互联网 发布:数控机床怎么存入编程 编辑:程序博客网 时间:2024/04/28 06:30
using System;
using System.Collections.Generic;
using System.Text;
namespace 从键盘上输入两个整数_由用户回答它们的和_差_积_商和取余运算结果_并统计出正确答案的个数
{
class Program
{
static void Main(string[] args)
{
int i = 0;
Console.WriteLine("请输入一个整数");
int x = int.Parse(Console.ReadLine());
Console.WriteLine("请再输入一个整数");
int y = int.Parse(Console.ReadLine());
int sum = x + y;
int difference = x - y;
int product = x * y;
int shang = x / y;
int yu = x % y;
Console.WriteLine("请输入和");
int he=int.Parse(Console.ReadLine());
if (sum == he)
{
i++;
}
Console.WriteLine("请输入差");
int cha=int.Parse(Console.ReadLine());
if (cha == difference)
{
i++;
}
Console.WriteLine("请输入积");
int ji = int.Parse(Console.ReadLine());
if (ji == product)
{
i++;
}
Console.WriteLine("请输入商");
int Sa = int.Parse(Console.ReadLine());
if (Sa == shang)
{
i++;
}
Console.WriteLine("请输入余");
int YU = int.Parse(Console.ReadLine());
if (YU == yu)
{
i++;
}
Console.WriteLine("您回答对了{0}个", i);
Console.ReadKey();
}
}
}
- 从键盘上输入两个整数_由用户回答它们的和_差_积_商和取余运算结果_并统计出正确答案的个数
- 2、从键盘上输入两个整数,由用户回答它们的和,差,积,商和取余运算结果,并统计出正确答案的个数。
- 11_输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数
- _ _FILE_ _和_ _LINE_ _
- 装饰设计模式_装饰和继承的区别_字节流_读取键盘录入
- @_ 和$_
- stl的string的典型操作_初始化_遍历_连接_和字符指针转化_查找替换_删除_插入_常用算法
- ^_^
- ^_^
- ^_^
- ^_^
- *_&
- ...!@~....!@#....+_#%.
- ^_^
- ^_^
- ^_^
- ^_^
- *_*
- 简单Linux服务器的基本配置
- 2013.1.10
- 重命名 delphi 编译输出文件名
- Java 正则表达式详解
- 技术从此开始
- 从键盘上输入两个整数_由用户回答它们的和_差_积_商和取余运算结果_并统计出正确答案的个数
- Ubuntu Virtualbox桥接 配置
- window 下 安装 Informatica PowerCenter 8.1.1——Server(图)
- hexdump(breaf)
- [dx] 绘制平面顶点绕序 应注意的小问题
- Maven 安装与配置(二)安装目录分析
- 找不到opencv头文件"cv.h"错误处理
- MPLS /VPN 实验一:OSPF / STATIC
- MonkeyRunner实现模拟按键(二)