[問題] 關於輸出控制換行
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Dev-C
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
餵入的資料(Input):
自動輸出的
預期的正確結果(Expected Output):
H G F E D C B A
G F E D C B A
F E D C B A
....
A
錯誤結果(Wrong Output):
會有超出ASCII的亂碼
程式碼(Code):(請善用置底文網頁, 記得排版)
#include <stdlib.h>
#include "iostream"
int main(void) {
int a='H';
for(int c=1;c<9;c++){
for(int b=1;b<9;b++){
printf("%c",a--);
}
printf("\n");
}
system("PAUSE");
return 0;
}
補充說明(Supplement):
請問這樣怎麼改才能正確輸出呢??
thanks!!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.39.8.150
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1405688771.A.490.html
→
07/18 22:29, , 1F
07/18 22:29, 1F
推
07/18 22:29, , 2F
07/18 22:29, 2F
→
07/19 02:17, , 3F
07/19 02:17, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章