1181
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; getchar(); string a; int num = 0; for (int i = 1; i <= n; i++) { getline(cin, a); if (!(a[0] == 65 || a[0] == 66 || a[0] == 67 || a[0] == 68 || a[0] == 69 || a[0] == 70 || a[0] == 71 || a[0] == 82 || a[0] == 83 || a[0] == 84)) { num++; } } cout << num; return 0; }
1182
#include <bits/stdc++.h> using namespace std; int main() { string a; getline(cin, a); for (int i = 0; i < a.size(); i++) { if (a[i] >= 65 && a[i] <= 90) { a[i] += 32; cout << a[i]; } else if(a[i]>=97&&a[i]<=122) { a[i] -= 32; cout << a[i]; } else { cout << a[i]; } } return 0; }
1183
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int* p = new int[n]; for (int i = 0; i < n; i++) { cin >> p[i]; } sort(p, p + n); int num = 0; int judge = 0; for (int i = 0; i < n; i++) { for (int j = i - 1; j >= 0; j--) { if (p[i] == p[j]) { judge = 1; } } if (judge == 0) { num++; } judge = 0; } cout << num << endl; for (int i = 0; i < n; i++) { for (int j = i - 1; j >= 0; j--) { if (p[i] == p[j]) { judge = 1; } } if (judge == 0) { cout << p[i] << endl; } judge = 0; } delete[]p; return 0; }
1184
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int num = 1; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cout << setw(3) << num; num++; } cout << endl; } return 0; }
1185
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int num = n * (n - i) + 1; for (int j = 1; j <= n; j++) { cout << setw(3) << num; num++; } cout << endl; } return 0; }
1186
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cout << setw(3) << i + (j - 1) * n; } cout << endl; } return 0; }
1187
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cout << setw(3) << n * (n - 1) + i - (j - 1) * n; } cout << endl; } return 0; }
1188
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cout << setw(3) << n * (n - i + 1) - (j - 1); } cout << endl; } return 0; }
1189
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { cout << setw(3) << n * i - (j - 1); } cout << endl; } return 0; }
1190
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (i == j) { a[i][j] = 1; cout << setw(3) << a[i][j]; } else { a[i][j] = 0; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1191
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (j ==n+1-i) { a[i][j] = 1; cout << setw(3) << a[i][j]; } else { a[i][j] = 0; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1192
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { a[i][j] = i + j - 1; cout << setw(3) << a[i][j]; } cout << endl; } return 0; }
1193
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (i + j - 1 <= n) { a[i][j] = i + j - 1; cout << setw(3) << a[i][j]; } else { a[i][j] = -(i + j) + 2 * n + 1; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1194
#include <bits/stdc++.h> using namespace std; int main() { int n; char a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (i + j - 1 <= n) { a[i][j] = 64 + i + j - 1; cout << setw(3) << a[i][j]; } else { a[i][j] = 64 + i + j - n - 1; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1195
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (i == j) { a[i][j] = n; cout << setw(3) << a[i][j]; } else { int num = abs(i - j); a[i][j] = n - num; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1196
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (j <= i) { a[i][j] = j; cout << setw(3) << a[i][j]; } else { a[i][j] = i; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1197
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (j <= i) { a[i][j] = n + 1 - i; cout << setw(3) << a[i][j]; } else { a[i][j] = n + 1 - j; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1198
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (n + 1 - j > n + 1 - i) { a[i][j] = n + 1 - j; cout << setw(3) << a[i][j]; } else { a[i][j] = n + 1 - i; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1199
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (j < i) { a[i][j] = i; cout << setw(3) << a[i][j]; } else { a[i][j] = j; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
1200
#include <bits/stdc++.h> using namespace std; int main() { int n; int a[10][10]; cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (n + 1 - j > i) { a[i][j] = i; cout << setw(3) << a[i][j]; } else { a[i][j] = n + 1 - j; cout << setw(3) << a[i][j]; } } cout << endl; } return 0; }
如果你喜欢我的博客可以点个赞支持一下。