mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-23 15:48:42 +00:00
parent
419164ec2b
commit
25e3fb1d7c
16
【实践课外】0.熟悉编程环境/7-1 重要的话说三遍.cpp
Normal file
16
【实践课外】0.熟悉编程环境/7-1 重要的话说三遍.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cout << "I'm gonna WIN!" << endl;
|
||||
cout << "I'm gonna WIN!" << endl;
|
||||
cout << "I'm gonna WIN!" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
14
【实践课外】0.熟悉编程环境/7-2 计算平均分.cpp
Normal file
14
【实践课外】0.熟悉编程环境/7-2 计算平均分.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cout << "math = 87, eng = 72, comp = 93, average = " << (87 + 72 + 93) / 3 << endl;
|
||||
|
||||
return 0;
|
||||
}
|
19
【实践课外】0.熟悉编程环境/7-3 计算长方形的周长和面积.cpp
Normal file
19
【实践课外】0.熟悉编程环境/7-3 计算长方形的周长和面积.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int a, b;
|
||||
|
||||
cin >> a >> b;
|
||||
|
||||
cout << "C = " << (a + b) * 2 << endl;
|
||||
cout << "S = " << a * b << endl;
|
||||
|
||||
return 0;
|
||||
}
|
19
【实践课外】0.熟悉编程环境/7-4 简单最值.cpp
Normal file
19
【实践课外】0.熟悉编程环境/7-4 简单最值.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int a, b, c;
|
||||
|
||||
cin >> a >> b >> c;
|
||||
|
||||
cout << std::max({a, b, c}) << endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user