Chương trình in ra tháp số
March 07, 2023
Viết chương trình in ra màng hình tháp số có dạng như sau:
1
22
333
4444
55555
1
22
333
4444
55555
Bài Giải
/*
Name: Thap so
Copyright: None
Author: Tran Anh
Description: https://gimi.vn
*/
#include<conio.h>
#include <stdio.h>
main()
{
int i,j;
for (i=1;i<=5;i++)
{
for (j=1;j<=i;j++)
printf("%d",i);
printf("\n");
}
getch();
return 0;
}
Name: Thap so
Copyright: None
Author: Tran Anh
Description: https://gimi.vn
*/
#include<conio.h>
#include <stdio.h>
main()
{
int i,j;
for (i=1;i<=5;i++)
{
for (j=1;j<=i;j++)
printf("%d",i);
printf("\n");
}
getch();
return 0;
}
Post a Comment