DAY 2
1
Software Development

## 99乘法表到底可以怎麼玩? [1] \t排版

``````  int main(){
for(int y=1;y<=9;y++){
for(int x=1;x<=9;x++){
printf("%d * %d=%d    ",y,x,y*x);
}  }
return 0;
}
``````

======================分格======================

``````int main(){
for(int y=1;y<=9;y++){
for(int x=1;x<=9;x++){
printf("%d * %d=%d \n",y,x,y*x );
}  }
return 0;
}
``````

======================分格======================

``````int main(){
for(int y=1;y<=9;y++){
for(int x=1;x<=9;x++){
printf("%d * %d=%d",y,x,y*x );
}
printf("\n");
}
return 0;
}
``````

======================分格======================

``````int main(){
for(int y=1;y<=9;y++){
for(int x=1;x<=9;x++){
printf("%d * %d=%d\t",y,x,y*x );

}
printf("\n");
}
return 0;
}
``````

======================分格======================

``````#include <stdio.h>
#include <stdlib.h>
int main(){
for(int y=1;y<=9;y++){
for(int x=1;x<=9;x++){
printf("%d*%d=%d\t",y,x,y*x );

}
printf("\n");
}
return 0;
}
``````

======================分格======================

``````int main(){
printf("123456\t");
printf("123456");
printf("\n");
printf("1234567\t");
printf("1234567");
printf("\n");
printf("12345678\t");
printf("12345678");
printf("\n");
printf("123456789\t");
printf("12345678");
printf("\n");
return 0;
}
``````

======================分格======================

``````int main(){
printf("123456\t");
printf("1234567891234");
printf("\n");
printf("1234567\t");
printf("1");
printf("\n");
printf("12345678\t");
printf("1");
printf("\n");
printf("123456789123456789\t");
printf("1");
printf("\n");
return 0;
}
``````

======================分格======================

\t是以每8個作一個區分，因為要留一空白作區隔，因此最高為7個字元

======================分格======================

(其實我也沒有想到做九九乘法表，最後會思考\t排版問題...)

### 1 則留言

0

iT邦新手 4 級 ‧ 2017-12-26 14:03:44