添加答案
添加答案
练习1:
int num1 = convert.toint32(console.readline());
int num2 = convert.toint32(console.readline());
console.writeline(num1+num2);
练习2:
int num1 = convert.toint32(console.readline());
int num2 = convert.toint32(console.readline());
console.writeline((int)((num1+num2)/2));
1
int a = Convert.ToInt32(Console.ReadLine());
int b= Convert.ToInt32(Console.ReadLine());
int c = a + b;
Console.WriteLine(c);
2.
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = a + b;
double ave = c / 2;
Console.WriteLine(ave);
3.
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
double c= a/ b;
Console.WriteLine(c);
4.
1;2;3;5;
5.
a
6.
a
练习1:
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(a+b); √
还可以再赋值一个C作为结果输出
int c=a+b
练习2:
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine((a+b)/2); √
练习:
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = a / b;
Console.WriteLine(c); √
练习3:
1、2、3、5 √
练习4:
A √
练习5:
A √
using System;
namespace _005_练习题
{
class Program
{
static void Main(string[] args)
{
//int a = Convert.ToInt32(Console.ReadLine());
//int b = Convert.ToInt32(Console.ReadLine());
//int c = a + b;
//Console.WriteLine(c);
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = (a + b) / 2;
Console.WriteLine(c);
}
}
}
变量名不能用特殊字符
int a=convert.toint(console.readline());
int b=convert.toint(console.readline());
int c= a+b;
第三题
12356
第四题A
第五题A
@:取消转义字符
例:D://test; 相当于@D:/test;
命名是以字母、数字、下划线组成,不能以数字开头
让用户计算两个整数的和
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = a+b;
Console.WriteLine(c);
可以计算乘法,+改成*ha
int a = Convert.ToInt32(Console.ReadLine());