摘要: #include<iostream> using namespace std; #include<string> #include<ctime> int main() { //添加随机数种子,作用利用当前系统时间生成随机数,防止每次随机数都一样 srand((unsigned int)time(NU 阅读全文
posted @ 2020-02-28 18:17 Jackie_Wang 阅读(731) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; #include<string> int main() { //多元分支 cout << "请输入学生的分数:" << endl; int score; cin >> score; cout << "您输入学生的分数为: 阅读全文
posted @ 2020-02-28 09:42 Jackie_Wang 阅读(332) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; #include<string> int main() { //三目运算符 int a = 10; int b = 20; int c = 0; c = (a > b ? a : b); cout << "c=" << 阅读全文
posted @ 2020-02-28 09:21 Jackie_Wang 阅读(1497) 评论(0) 推荐(0) 编辑