| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 138549 | 严鑫亮 | 奇偶位互换 | C++ | Wrong Answer | 3 MS | 272 KB | 694 | 2025-11-27 15:29:27 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int num = 0; cin >> num; for(int i = 0; i < num; i++) { char number[100] = {0}; cin >> number; int len1 = strlen(number); for(int j = 0;j<len1;j++) { if(number[j] == '0') number[j] = '1'; else if(number[j] == '1') number[j] = '0'; } for(int j = 0;j<len1;j++) cout << number[j]; } return 0; }
------Input------
100 1010001110000111 1000010111 000001011110101001111111001110110111010010111111 10011010010000 1010101011101001000110 100010011101111000100000010110001000001100101111 010100100111100010011011000000000001001011101011 100011010101011010 001100011101001111010111001000010010011001100001 011111100011011100010011101011110010 0000100110 111010011001100001100111 001010111000001011000100010011100011011111000111 111101101000010000111111 1100000000110110101100001101 11010111011101 0010001111 1001011101 00
------Answer-----
0101001101001011 0100101011 000010101101010110111111001101111011100001111111 01100101100000 0101010111010110001001 010001101110110100010000101001000100001100011111 101000011011010001100111000000000010000111010111 010011101010100101 001100101110001111101011000100100001100110010010 101111010011101100100011010111110001 0000011001 110101100110010010011011 000101110100000111001000100011010011101111001011 111110010100100000111111 1100000000111001011100001110 11101011101110 0001001111 0110101110 000101
------Your output-----
01011100011110000111101000111110100001010110000000110001001000101101000000011001011011110101010100010110111001011101100010000111011111101001110111110011010000101011011000011101100100111111111110110100010100011100101010100101110011100010110000101000110111101101100110011110100000011100100011101100010100001101111101100100010110011001111001100011010100011111010011101110110001110010000011100000001001011110111100000000111111110010010100111100100010100010001011011100000110100010110101001000110011000101