```c++ //cpp: #include #include #include using namespace std; int main() { #ifdef LOCAL freopen("D:\\datain.txt", "r", stdin); #endif int a; char b; scanf("%d %c", &a, &b); int n = floor(sqrt((float)(a+1)/2)); int yushu = a - 2 * pow(n,2) + 1; for (int i = 0; i < n; i++) { for (int j = 0; j < i; j++) printf(" "); for (int j = 0; j < 2 * (n - i) - 1; j++) printf("%c", b); printf("\n"); } for (int i = 1; i < n; i++) { for (int j = 0; j < n - i-1; j++) printf(" "); for (int j = 0; j < 2 * i + 1; j++) printf("%c", b); printf("\n");
//cpp: #include <iostream> #include <algorithm> #include<math.h> using namespace std; int main() { #ifdef LOCAL freopen("D:\\datain.txt", "r", stdin); #endif LOCAL int a, b; cin >> a >> b; float c = (float)(b - a) / 100.0 + 0.5; int c1 = floor(c); int h = c1 / 3600; int m = (c1 - h * 3600) / 60; int s = c1 % 60; printf("%02d:%02d:%02d", h, m, s); return 0; }
//cpp: #include <iostream> #include <algorithm> using namespace std; int main() { #ifdef LOCAL freopen("D:\\datain.txt", "r", stdin); #endif int first, k, n, temp; cin >> first >> n >> k; int data[100005], next[100005], list[100005]; for (int i = 0; i < n; i++) { cin >> temp; cin >> data[temp] >> next[temp]; } int sum = 0;//不一定所有的输入的结点都是有用的,加个计数器 while (first != -1) { list[sum++] = first; first = next[first]; } for (int i = 0; i < (sum - sum % k); i += k) reverse(begin(list) + i, begin(list) + i + k); for (int i = 0; i < sum - 1; i++) printf("%05d %d %05d\n", list[i], data[list[i]], list[i + 1]); printf("%05d %d -1", list[sum - 1], data[list[sum - 1]]); return 0; }
```c++ #include #include #include #include #include #include #include using namespace std;
```c++ #include #include #include #include #include #include using namespace std;
```c++ #include #include #include #include
```c++ #include #include #include #include #include #include using namespace std;
```c++ #include #include #include #include #include #include using namespace std; struct d { double q; double lr;//利润 double bl;//比率 }; bool cmp(d a, d b) { return a.bl > b.bl; } int main() { #ifdef LOCAL freopen("d:\\datain.txt", "r", stdin); //freopen("d:\\dataout.txt", "w", stdout); #endif LOCAL vector data; int n, D; cin >> n >> D; //cout << n << " " << D << endl;
```c++ #include #include #include #include #include #include using namespace std; int main() { #ifdef LOCAL freopen("d:\\datain.txt", "r", stdin); //freopen("d:\\dataout.txt", "w", stdout); #endif LOCAL string n; cin >> n; n.insert(0, 4 - n.length(), '0'); bool f = false; for (int i = 0; i < n.length(); i++) { if (n[0]!=n[i]) { f = true; break; } } int a, b; string t1, t2; int n1 = stoi(n);
对于string与int的转换, 刷题用stoi(string)函数和to_string(int)函数
大学Java课程设计: 基于websocket的web聊天室 Spring + Spring MVC + Mybatis + mysql
大学数据库课程设计: 基于Web的宾馆管理系统 jsp+servlet+mysql 前端semantic MVC
godal provides the ability to generate specific golang code. The godal is to enable developers to write fast code in an expressive way.