Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ C language print various graphic     - Ubuntu Linux use MAC binding against ARP attacks (Linux)

- Docker improve safety (Server)

- Oracle metadata Reconstruction experiments (Database)

- ASM learning overview (Database)

- Ordinary users how to use the firewall software (Linux)

- AngularJS notes --- Data Binding (Programming)

- Use OpenSSL carried BASE64 encoding and decoding (Linux)

- Linux screen command (Linux)

- Use web2py + uWSGI + Nginx Web server built on Linux (Server)

- ImportTsv-HBase data import tool (Database)

- 10 Linux in the passwd command examples (Linux)

- OpenSSH server configuration file for each Common Definition (Server)

- Ubuntu 14.04 Install WordPress on Nginx (Server)

- Detailed installation of CentOS 6.x (Linux)

- Oracle 11g new features and associated SQL TUNING (Database)

- Ubuntu 14.04 build Hadoop 2.5.1 standalone and pseudo-distributed environment (32-bit) (Server)

- ORA-00020: No more process state objects available (Database)

- Linux folder and extract the differential file comparison techniques -rsync Magical (Linux)

- Apache Tomcat integration and resin (Server)

- Tune in high resolution to 1280x800 in Fedora 14 (Linux)

 
         
  C language print various graphic
     
  Add Date : 2018-11-21      
         
         
         
  C language with a variety of graphics can be printed circulation

A right triangle (right standing): part of the code

  int i, j;
    for (i = 0; i <6; i ++) {
        for (j = 6; j> i; j--) {
            printf ( "");
        }
        for (j = 0; j <= i; j ++) {
            printf ( "*");
        }
        printf ( "\ n");
    }

There are a variety of right-angled triangle is not introduced one by one.

2. isosceles triangle (upright) part of the code is as follows:

int i, j;

for (i = 0; i <6; i ++) {

    for (j = 6; j> i; j--) {

        printf ( "");

    }

    for (j = 0; j <2 * i + 1; j ++) {

        printf ( "*");

    }

    printf ( "\ n");

}

Inverted isosceles triangle:

int i, j;

for (i = 0; i <6; i ++) {

    for (j = 0; j
        printf ( "");

    }

    for (j = 0; j <11-2 * i; j ++) {

        printf ( "*");

    }

   

    printf ( "\ n");

  }

3. diamond

Code:

int i, j, k;

for (i = 1; i <= 5; i ++) {

    for (j = 6; j> i; j -) {

        printf ( "");

    }

    for (k = 1; k <= 2 * i-1; k ++) {

        printf ( "*");

    }

    printf ( "\ n");

}

for (i = 1; i <= 6; i ++) {

        for (j = 1; j <= i-1; j ++) {

            printf ( "");

        }

        for (k = 1; k <= 13-2 * i; k ++) {

            printf ( "*");

        }

        printf ( "\ n");

        }

4. open triangles

Code:

int i, j;

for (i = 0; i <5; i ++) {

    for (j = 5; j> i; j--) {

        printf ( "");

    }

    for (j = 0; j <2 * i + 1; j ++) {

        if (j == 0 || j == 2 * i || i == 0 || i == 4) {

            printf ( "*");

        } Else {

            printf ( "");

        }

     

    }

    printf ( "\ n");

}

5. Hollow diamond: its principle and almost hollow triangle

Code is as follows:

int i, j;

for (i = 0; i <4; i ++) {

    for (j = 3; j> i; j--) {

        printf ( "");

    }

    for (j = 0; j <2 * i + 1; j ++) {

       

        if (j == 0 || j == 2 * i) {

            printf ( "*");

        } Else {

            printf ( "");

        }

    }

    printf ( "\ n");

}

for (i = 0; i <4; i ++) {

    for (j = 0; j
        printf ( "");

    }

    for (j = 0; j <7-2 * i; j ++) {

        if (j == 0 || j == 6-2 * i) {

            printf ( "*");

        } Else {

            printf ( "");

        }

    }

    printf ( "\ n");

}


6, Pine

Code is as follows:

// Christmas

  int i, j;

  for (i = 0; i <3; i ++) {

      for (j = 4; j> i; j--) {

          printf ( "");

      }

      for (j = 0; j <2 * i + 1; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <4; i ++) {

      for (j = 4; j> i; j--) {

          printf ( "");

      }

      for (j = 0; j <2 * i + 1; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <5; i ++) {

      for (j = 4; j> i; j--) {

          printf ( "");

      }

      for (j = 0; j <2 * i + 1; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <5; i ++) {

      for (j = 0; j <3; j ++) {

          printf ( "");

      }

      for (j = 0; j <3; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }

  for (i = 0; i <2; i ++) {

      for (j = 0; j <10; j ++) {

          printf ( "*");

      }

      printf ( "\ n");

  }
     
         
         
         
  More:      
 
- Linux-- sub-volume compression and decompression (Linux)
- Analysis of Java in the deep copy and shallow copy (Programming)
- The oh-my-zsh into true my zsh (Linux)
- Linux Workstation Security Checklist - from the Linux Foundation Internal (Linux)
- Lua non-blocking write log (Programming)
- Python 3.5 will support Async / Await Asynchronous Programming (Programming)
- Performance issues under CentOS 6.5 VLAN devices (Linux)
- Python function arguments * args and ** kwargs usage (Programming)
- Java by Spy Memcached to cache data (Programming)
- Ubuntu upgrade to Linux Kernel 4.2.3 Kernel (Linux)
- CentOS7 method to upgrade the kernel to 3.18 (Linux)
- Linux Getting Started tutorial: 3D effects and beautify your desktop (Linux)
- Java concurrent programming combat (using synchronized synchronization method) (Programming)
- Share Practical Tutorial GitHub (Linux)
- Linux system performance monitoring with Nmon (Linux)
- Java 8 perspective annotation types (Programming)
- RHEL 6.5 x86_64 CentOS yum configuration source (Linux)
- Oracle Automatic Diagnostic Repository (Automatic Diagnostic Repository, ADR) (Database)
- Oracle Client + PL SQL Developer enables remote access to the Oracle database (Database)
- Install Ubuntu 14.04 and Windows 8 / 8.1 dual-boot in UEFI mode (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.