例3.1 输出表达式的值
STOJ | 【例3.1】 输出表达式的值
#include<bits/stdc++.h>
using namespace std;
int main(){
cout << "1234 * 5678 = " << 1234 * 5678;
return 0;
}
例3.2 打印长方形
STOJ | 【例3.2】 打印长方形
#include<bits/stdc++.h>
using namespace std;
int main(){
cout << "ABCDEFGHIJKLMNOPQR" << endl;
cout << "BABCDEFGHIJKLMNOPQ" << endl;
cout << "CBABCDEFGHIJKLMNOP" << endl;
cout << "DCBABCDEFGHIJKLMNO" << endl;
cout << "EDCBABCDEFGHIJKLMN" << endl;
cout << "FEDCBABCDEFGHIJKLM" << endl;
cout << "GFEDCBABCDEFGHIJKL" << endl;
cout << "HGFEDCBABCDEFGHIJK" << endl;
cout << "IHGFEDCBABCDEFGHIJ" << endl;
cout << "JIHGFEDCBABCDEFGHI" << endl;
return 0;
}
练3.1 唐诗春晓
STOJ | 练3.1 唐诗春晓
#include<bits/stdc++.h>
using namespace std;
int main(){
cout << "春晓" << endl;
cout << "春眠不觉晓," << endl;
cout << "处处蚊子咬。" << endl;
cout << "夜来嗡嗡声," << endl;
cout << "脓包知多少。" << endl;
return 0;
}
练3.2 雪花
STOJ | 练3.2 雪花
#include<bits/stdc++.h>
using namespace std;
int main(){
cout << "1+2+3+4=" << 1+2+3+4 << endl;
return 0;
}
练3.3 01子串
STOJ | 练3.3 01子串
#include<bits/stdc++.h>
using namespace std;
int main(){
cout << "000" << endl;
cout << "001" << endl;
cout << "010" << endl;
cout << "011" << endl;
cout << "100" << endl;
cout << "101" << endl;
cout << "110" << endl;
cout << "111" << endl;
return 0;
}