梅紫蘇 #4689(2007/12/09 04:40 GMT) [ C++ ] Rating1/1=1.00
なんの捻りもなく。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
static const char* AMIDA[] = { "A B C D E", "| | |-| |", "|-| | |-|", "| |-| |-|", "|-| |-| |", "|-| | | |", NULL, }; int main(int argc, _TCHAR* argv[]) { char szAns[100]; strcpy(szAns, AMIDA[0]); printf("%s\n", AMIDA[0]); for (int n = 1; AMIDA[n] != NULL; n++) { printf("%s\n", AMIDA[n]); for (int p = 0; AMIDA[n][p] != '\0'; p++) { if ((AMIDA[n][p] == '-') && (p > 0)) { char c = szAns[p - 1]; szAns[p - 1] = szAns[p + 1]; szAns[p + 1] = c; } } } printf("%s\n", szAns); return 0; }
Rating1/1=1.00-0+
[ reply ]
梅紫蘇
#4689()
[
C++
]
Rating1/1=1.00
なんの捻りもなく。
Rating1/1=1.00-0+
[ reply ]