解题思路: A变T, C变G
注意事项:
参考代码:
#include <iostream> // #include <sstream> // #include <cstdio> // #include <algorithm> // #include <cmath> // #include <cstdlib> // #include <cstring> // #include <cctype> // #include <string> // #include <climits> // #include <map> // #include <vector> // #include <list> // #include <set> using namespace std; // const int maxn = 40004; // const long long MOD = 100000007; // const double PI = acos(-1.0); int main() { string s; cin >> s; for (auto it = s.begin(); it != s.end(); it++) { if (*it == 'A' || *it == 'T') cout << (char)('A'+'T'-*it); else cout << (char)('C'+'G'-*it); } return 0; }
0.0分
0 人评分
C二级辅导-公约公倍 (C语言代码)浏览:1517 |
C语言训练-素数问题 (C语言代码)浏览:1662 |
printf基础练习2 (有点不明白)浏览:848 |
C语言程序设计教程(第三版)课后习题11.8 (C语言代码)浏览:891 |
WU-输出九九乘法表 (C++代码)浏览:1688 |
1113题解浏览:794 |
大家好,我是验题君浏览:578 |
字符串输入输出函数 (C语言代码)浏览:2498 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:623 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:591 |