摘要: #include <iostream> using namespace std; int Ssmallest(int q, int w, int e); int a, b, c; int d, e, f; int smallest; int main() { Ssmallest(d, e, f); 阅读全文
posted @ 2021-07-01 15:26 江南王小帅 阅读(164) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int main(){ float a, b, s; cout << "a b" << endl; cin >> a >> b; s = a; if (a < b) { s = b; //if语句中只有这一个语句,可省略 阅读全文
posted @ 2021-07-01 15:03 江南王小帅 阅读(44) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int main() { //测试表达式类型的转换 int n = 100, m; double x = 3.4157, y; cout << "n*x = " << n * x << endl; //赋值类型转换 m 阅读全文
posted @ 2021-07-01 14:57 江南王小帅 阅读(17) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int main() { //用 sizeof 计算各类种常量的字节长度 cout << "sizeof('\(') = " << sizeof('\)') << endl; cout << "sizeof(1) = 阅读全文
posted @ 2021-07-01 14:44 江南王小帅 阅读(215) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int main() { //按位与 cout << "32&12=" << (32 & 12) << endl; //按位异或 cout << "43^23 = " << (43 ^ 23) << endl; //按 阅读全文
posted @ 2021-07-01 14:26 江南王小帅 阅读(66) 评论(0) 推荐(0)
摘要: // Project23.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> using namespace std; int main() { char name1[50]; char name2[50]; /cin >> nam 阅读全文
posted @ 2021-07-01 11:01 江南王小帅 阅读(36) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int main(){ float a = 3.5, b = 2.2, c = 0; cout << "a = " << a << " b = " << b << " c = " << c << endl; //与运算 阅读全文
posted @ 2021-06-30 17:07 江南王小帅 阅读(90) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int main() { //变量声明 char c; double x,y; //测试自增 cout<<"++E and E++ :"<<endl; c='B'; cout<<"c="<<++c<<endl; //输 阅读全文
posted @ 2021-06-29 16:33 江南王小帅 阅读(40) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int main() { //定义枚举类型,并指定其枚举元素的值 enum color ; //声明枚举变量a和b,并为枚举变量a赋初值 enum color a = RED; color b; //合法,与C语言不同 阅读全文
posted @ 2021-06-29 16:23 江南王小帅 阅读(21) 评论(0) 推荐(0)
摘要: #include<iostream>const double PI = 3.14;using namespace std; int main(){ //declare variables double r, l, s; // enter the radius of circle cout << "r 阅读全文
posted @ 2021-06-29 16:07 江南王小帅 阅读(53) 评论(0) 推荐(0)