看板 ck57th328 關於我們 聯絡資訊
#include<iostream.h> int main() { int a; int c; for(a=1;a<10;a++) { cout <<a<<"*"<<a<<"="<<a*a<<" "; } cout<<" \n"; cin >> c; return 0; } 用Dev寫出來的(所以會有一個無緣無故出現的c) 但輸出結果無法分行 另外 #include<iostream.h> int main() { int c; char end1; char C[5][5]={ {1,1,1,1,1}; {1,0,0,0,1}; {1,0,0,0,0}; {1,0,0,0,1}; {1,1,1,1,1}; }; for(int i=0;i<5;i++) { for(int j=0;j<5;j++) { if(C[i][j] == 1) cout <<"c"; else cout <<" "; } cout<<end1; } cin>>c; return 0; } 這也是一樣 無法分行 我已經改用setw試過了 結果相同 請旻光幫忙解一下吧 -- When you have eliminated the possible, whatever remain however improbable, must be the truth. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.220.132