您的答案為: *DEC is the trademark of the Digital Equipment Corporation.orpor ...略 正確答案為: *DEC is the trademark of the Digital Equipment Corporation.
為什麼前面對,但是後面會多一小串 我在測試的時候沒問題
#include<stdio.h> #include<stdlib.h> int main() { int i=0; char input[101] = {0}; char output[101] = {0}; while (scanf("%s", input)==1) { for (int i = 0; i < 101; i++) { if ((int)input[i] != 0) output[i] = (int)input[i] - 7; } for (int i = 0; i < 101; i++) { if ((int)output[i] != 0) printf("%c", output[i]); } printf("\n"); } return 0; }