#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main() {
int sum = 0;
for (int i = 50; i <= 100; ++i) {
sum += i;
}
cout << sum << endl;
}
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main() {
for (int i = 10; i >= 0; --i) {
cout << i << " ";
}
cout << endl;
}
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main() {
int start = 0, end = 0, temp = 0;
cin >> start >> end;
if (start > end) {
temp = start;
start = end;
end = temp;
}
for (int i = start; i <= end; ++i) {
cout << i << " ";
}
cout << endl;
}
网友评论