Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
34315 | hu | 输出亲朋字符串 | C++ | Accepted | 0 MS | 256 KB | 326 | 2023-12-18 19:33:08 |
#include<bits/stdc++.h> using namespace std; int main() { char a[101], b[101]; cin >> a; //'\0':字符串结束的标志 int len = strlen(a);//计算字符串的长度 for(int i = 0; i < len - 1;i++) { char c = a[i] + a[i + 1]; cout << c; } char c = a[0] + a[len - 1]; cout << c; return 0; }