Skip to main content

[C/C++] Bài tháp số C/C++

Nhập vào chiều cao của tháp, In ra tháp số giảm dẫn theo chiều cao và tướng số lượng phần tử tăng dần.
Source code:

#include<stdio.h>
int main()
{
 int i,j,k,n,a,b;
 printf("Nhap chieu cao? ");
 scanf("%d",&n);
 n=n*2;

 for(i=1;i<n;i+=2)
 {
  for(j=n-1;j>i;j-=2)
   printf(" ");
  for(k=1;k<=(i/2)+1;++k)
   printf("%d",k);
  for(k=i/2;k>=1;--k)
   printf("%d",k);
  printf("\n");
 }
 scanf("%d",&n);
 return 0;
}

Comments

Popular posts from this blog

Socket Android Client to PC Server C#

Using AsynCallback C# Android Client connect Server C# Source code:  http://ow.ly/OlXj309O1mj c# socket multi client, socket c# example, socket server c#, socket c# tutorial, asynchronous socket in c#, c# socket multiple clients, c# socket server multiple clients, Download source code:  Click Here

Bài tập thuật toán C/C++ Và Tuyển tập đề thi olympic

Gồm: +  Các thuật toán của Lê Minh Hoàng + Tuyển tập các đề thi olympic tin học sinh viên Link down: Tại đây

Cross Platform Mobile App: Demo shop with flutter

Cross Platform Mobile App: Demo shop with flutter So cool framework from google <3  Demo:  Demo Code console.print("hello")