In the c ++ Command Prompt window, print the specified diamond code.

Source: Internet
Author: User
Tags net time net send

In the c ++ Command Prompt window, print the specified diamond code.

Print the specified diamond code in the c ++ Command Prompt window

In VS2010, create an empty project, add the source file, and paste the code.

You can change the size of the maxRows value to control the diamond size.

# Include <stdio. h ># include <cstdlib> // Add the dependent header file void main () {int I, j, k; int maxRows = 12; // control the diamond size // print the preceding four rows for (I = 1; I <maxRows; I ++) {for (j = 1; j <maxRows-I; j ++) // controls the number of spaces to print printf (""); for (k = 1; k <= 2 * I-1; k ++) // control the number of stars to be printed printf ("*"); printf ("\ n") ;}// print the three rows below for (I = 1; I <= maxRows-2; I ++) {for (j = 1; j <= I; j ++) // control the number of spaces to print printf (""); for (k = 1; k <= (maxRows-I) * 2-3; k ++) // control the number of stars to print printf ("*"); printf ("\ n");} system ("pause" ); // For display, press any key to continue ......, In this way, the program will not exit immediately .}

:




How do I set the window size (the window in the command prompt) at the command prompt )?

? Is the window size ,? Is a number
Modify as needed
The Code is as follows:

Mode con: cols =? Lines =?

Command Prompt code

I,
Net use \ ip \ ipc $ ""/user: "" Create an empty IPC Link
Net use \ ip \ ipc $ "password"/user: "user Name" Create an IPC non-empty Link
Net use h: \ ip \ c $ "password"/user: "user Name" directly log on and map to the other Party C: to the local H:
Net use h: \ ip \ c $ after login ing to the other Party C: to the local H:
Net use \ ip \ ipc $/del Delete IPC Link
. Net use h:/del: Delete the H ing from the ing peer to the local host that is h:
Net user username and password/add create user
Net user guest/active: yes to activate the guest user
. Net user.
Net user account name view account attributes
Net localgroup administrators user name/add "user" to the Administrator for management
Member permission. Note: The administrator is followed by s in the plural.
Net start to check which services are enabled
. Net start service name. (For example, net start telnet and net start schedule)
Net stop service name to stop a service
Net time \ target ip address view peer time
Net time \ target ip Address/set to set the time synchronization between the local computer time and the "target IP" host, add the parameter/
Yes can cancel confirmation Information
. Net view.
Net view \ ip to view which shares are enabled in the Peer LAN
Net config display system network settings
. Net logoff disconnection sharing
. Net pause service name: suspend a service
Net send ip "Text Information" sends information to the recipient
Network Connection type and information being used in the net ver LAN
. Net share
Net share ipc $ enable ipc $ share
Net share ipc $/del Delete ipc $ share
Net share c $/del Delete C: share
Net user guest 12345 after logging in with the guest user, change the password to 12345
Net password Change System Login password
Netstat-a is usually used to check which ports are enabled.
Netstat-n is commonly used to view the network connection of a port.
Netstat-v view ongoing work
Netstat-p protocol name example: netstat-p tcq/ip to view the use of a protocol (view the use of TCP/IP protocol)
Situation)
Netstat-s: view all protocol usage in use
Nbtstat-A ip address, if one of the ports from 136 to 139 is enabled, you can view the user name (
(Username before 03)-Note: Parameter-A must be capitalized.
Tracert-parameter ip (or computer name) tracking route (packet), parameter: "-w number" is used to set timeout
Interval ...... remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.