Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- int i,j,num;
- printf("直角二等辺三角形の底辺の*の数は? >");
- scanf("%d",&num);
- for(i=0;i<num;i++){
- for(j=0;j<num;j++){
- if(i==0){
- printf("*");
- } else {
- if(j==i||j==num-1){
- printf("*");
- } else {
- printf(" ");
- }
- }
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment