Welcome![Sign In][Sign Up]
Location:
Search - printf.c

Search list

[Other用c编写的N*N的螺旋矩阵源代码

Description:

/*
实现效果:
1 2 6 7 15
3 5 8 14 16
4 9 13 17 22
10 12 18 21 23
11 19 20 24 25
*/
#include <stdio.h>
#define N 5 //阶数,即N*N的螺旋矩阵

void main()
{
    int i, j, num=1, a[N][N];
    for(i=0; i<=N/2; i++)
    {
        for(j=i; j<N-i; j++) a[i][j]=n++;
        for(j=i+1; j<N-i; j++) a[j][N-i-1]=n++;
        for(j=N-i-2; j>i; j--) a[N-i-1][j]=n++;
        for(j=N-i-1; j>i; j--) a[j][i]=n++;
    }
    for(i=0; i<N; i++)
    {
        for(j=0; j<N; j++)
            printf("%2d ",a[i][j]);
        printf("\n");
    }
}
    

 

不知道叫什么,先叫它“回宫图”吧
年初的时候在贴吧瞎逛,看到了一个程序挺有意思,会输出如下的形状:
01 24 23 22 21 20 19
02 25 40 39 38 37 18
03 26 41 48 47 36 17
04 27 42 49 46 35 16
05 28 43 44 45 34 15
06 29 30 31 32 33 14
07 08 09 10 11 12 13
仔细看这个形状,数字是按顺序往里回旋的,觉得很有创意,可是一看源代码头就大了,
每个编程人都知道看别人的代码是很困难的,尤其像这种不知道思路的,所以也就放下
没管了。
昨天上物理课实在是没心思听,就想起这个程序,想了一节课,果然不负有心人,给弄出来了,这个是增强版的,可以输入1-10中的任意个数,然后生成图形。
先看代码,没有注释,所以不好看的懂。
#include<stdio.h>
main()
{
       int n,m,i,j,t,k=1;
       int a[11][11];
       clrscr();
       do{
       printf("please input a number(1-10):");
       scanf("%d",&n);
       }while(n<1||n>10);
       t=n+1;
       for(m=1;m<=t/2;m++)
         {
           for(i=m;i<=t-m;i++)
             {a[i][m]=k;k++;}
           for(j=m+1;j<=t-m;j++)
             {a[i-1][j]=k;k++;}
           for(i=n-m;i>=m;i--)
             {a[i][j-1]=k;k++;}
           for(j=n-m;j>=m+1;j--)
             {a[i+1][j]=k;k++;}
         }
       for(i=1;i<=n;i++)
         {
           for(j=1;j<=n;j++)
             {
               if(a[i][j]<=9) printf("0%d ",a[i][j]);
               else printf("%d ",a[i][j]);       }
           printf("\n");
         }
       getch();
}
就是这样的。


可以更简洁些:

#include<stdio.h>
main()
{
       int n,m,i,j,t,k=1;
       int a[11][11];
       clrscr();
       do{
       printf("please input a number(1-10):");
       scanf("%d",&n);
       }while(n<1||n>10);
       t=n+1;
       for(m=1;m<=t/2;m++)
         {
           for(i=m;i<=t-m;i++)
             a[i][m]=k++;
           for(j=m+1;j<=t-m;j++)
             a[i-1][j]=k++;
           for(i=n-m;i>=m;i--)
             a[i][j-1]=k++;
           for(j=n-m;j>=m+1;j--)
             a[i+1][j]=k++;
         }
       for(i=1;i<=n;i++)
         {
           for(j=1;j<=n;j++)
             {
               if(a[i][j]<=9) printf("0%d ",a[i][j]);
               else printf("%d ",a[i][j]);       }
           printf("\n");
         }
       getch();
}

 


 #include <stdio.h>
#define N 8
main(){
 int i,j,n=1,a[N][N];
 for(i=0;i<=N/2;i++){
  for(j=i;j<N-i;j++)
   a[i][j]=n++;
  for(j=i+1;j<N-i;j++)
   a[j][N-i-1]=n++;
  for(j=N-i-2;j>i;j--)
   a[N-i-1][j]=n++;
  for(j=N-i-1;j>i;j--)
   a[j][i]=n++;
 }
 for(i=0;i<N;i++){
  printf("\n\n");
  for(j=0;j<N;j++)
   printf("%5d",a[i][j]);
 }
}
 

 


                                马踏棋盘问题


#include <stdio.h>
#define N 5
void main(){
 int x,y;
 void horse(int i,int j);
 printf("Please input start position:");
 scanf("%d%d",&x,&y);
 horse(x-1,y-1);
}
void horse(int i,int j){
 int a[N][N]={0},start=0,
  h[]={1,2,2,1,-1,-2,-2,-1},
  v[]={2,1,-1,-2,2,1,-1,-2},
  save[N*N]={0},posnum=0,ti,tj,count=0;
 int jump(int i,int j,int a[N][N]);
 void outplan(int a[N][N]);
 a[i][j]=posnum+1;
 while(posnum>=0){
  ti=i;tj=j;
  for(start=save[posnum];start<8;++start){
   ti+=h[start];tj+=v[start];
   if(jump(ti,tj,a))
    break;
   ti-=h[start];tj-=v[start];
  }
  if(start<8){
   save[posnum]=start;
   a[ti][tj]=++posnum+1;
   i=ti;j=tj;save[posnum]=0;
   if(posnum==N*N-1){
    //outplan(a);
    count++;
   }
  }
  else{
   a[i][j]=0;
   posnum--;
   i-=h[save[posnum>;j-=v[save[posnum>;
   save[posnum]++;
  }
 }
 printf("%5d",count);
}
int jump(int i,int j,int a[N][N]){
 if(i<N&&i>=0&&j<N&&j>=0&&a[i][j]==0)
  return 1;
 return 0;
}
void outplan(int a[N][N]){
 int i,j;
 for(i=0;i<N;i++){
  for(j=0;j<N;j++)
   printf("%3d",a[i][j]);
  printf("\n");
 }
 printf("\n");
 //getchar();
}
用回溯法得到所有的解,但效率较低,只能算出5行5列的

 


Platform: | Size: 4395 | Author: good@588 | Hits:

[Other resourcec环境下的编译器

Description: 在c环境下的编译器 一.实验完成主要功能描述: 1.if语句 2.if_else语句 3.while语句 4.数组 5.函数调用 6.对外部函数printf的调用(用于打印) 二.测试环境 1.fedora core 4(OS) 2.lex version 2.5.4 3.yacc 4.gcc (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8) -in the context of a compiler. Experiments main function Description : 1.if statement 2.if_else statement 3.while statements 4. 5 array. Function call 6. The external function calls printf (print) 2. A test environment . fedora core 4 (OS) 2.lex 3.yacc 4.gcc version 2.5.4 (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8)
Platform: | Size: 5945 | Author: 韩天毅 | Hits:

[Other resourcec

Description: c++冒泡排序#include \"stdio.h\" void sort() { int i,count=0,a[20] int k=20 printf(\"please input 20 defferent numbers?\\n\") for(i=0 i<20 i++) scanf(\" %d\\a\",&a[i]) while(count<20) { for(i=0 i<k i++) { if(a[i] > a[i+1]) { int temp temp=a[i] a[i]=a[i+1] a[i+1]=temp } } count=count+1 } for(i=0 i<k i++) printf(\"%d\",a[i]) } void main() { sort() }
Platform: | Size: 623 | Author: 李仅 | Hits:

[ELanguageag

Description: 词法分析程序,可对以下的C源程序进行分析:main() {int a[12] ,sum for(i=1 i<=12 i++) {for(j=1 j<=12 j++)scanf(\"%d\",&a[i][j]) } for(i=12 i>=1 i--){ for(j=12 j>=1 j--){ if(i==j&&i+j==13)sum+=a[i][j] } } printf(\"%c\",sum) }-lexical analysis procedures, right below the C source code analysis : main () (int a [12] [12], the sum for (i = 1 ilt; I = 12) (for (j = 1 JLT; J = 12) Scanf ( "% d", a [i] [j])) for (i = 12 IGT; a = i --) (for (j = 12 IGT; = 1 j --) (if (i == ji j == 13) sum = a [i] [j])) printf ( "% c", sum
Platform: | Size: 1382 | Author: 范铮 | Hits:

[CSharp优美C语言(3)

Description: 3. 源程序要正确地运行,必须要有什么函数?(单选) A. printf函数 B. 自定义的函数 C. main函数 D. 不需要函数 答案: C-3. Source code to run correctly, we must have what function (Option) A. B. printf function defined function main function D. C. function need not answer : C
Platform: | Size: 15241 | Author: gjc | Hits:

[WEB Codec语言教程(www.vcok.com版)

Description: 经典c程序100例==1--10 【程序1】 题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 1.程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去       掉不满足条件的排列。 2.程序源代码: main() { int i,j,k printf(\"\\n\") for(i=1 i<5 i++)    /*以下为三重循环*/  for(j=1 j<5 j++)    for (k=1 k<5 k++)    {     if (i!=k&&i!=j&&j!=k)    /*确保i、j、k三位互不相同*/     printf(\"%d,%d,%d\\n\",i,j,k)    }-classic procedures hundred cases == 1 -- 10 procedures -- a topic : 1,2,3,4 figures, the number can be formed with each other with no repeat of the triple-digit figures? How many are? 1. Program Analysis : can fill the 100, 10, 000 the number of spaces are 1,2,3,4. With all the components removed after not satisfied with the conditions. 2. Source code : main () (int i, j, k printf ( "\\ n") for (i = 1 ilt; 5 i) / * the following as the triple cycle * / for (j = 1 JLT; 5 j) for (k = 1 KLT; 5 k) (if (i! = ki! = jj! = k) / * i, j, k three disparate * / printf ( "% d,% d,% d \\ n ", i, j, k
Platform: | Size: 304386 | Author: 刘宋 | Hits:

[Other resourceC++完美演绎2

Description: C++完美演绎 经典算法 如 /* 头文件:my_Include.h */ #include <stdio.h> /* 展开C语言的内建函数指令 */ #define PI 3.1415926 /* 宏常量,在稍后章节再详解 */ #define circle(radius) (PI*radius*radius) /* 宏函数,圆的面积 */ /* 将比较数值大小的函数写在自编include文件内 */ int show_big_or_small (int a,int b,int c) { int tmp if (a>b) { tmp = a a = b b = tmp } if (b>c) { tmp = b b = c c = tmp } if (a>b) { tmp = a a = b b = tmp } printf(\"由小至大排序之后的结果:%d %d %d\\n\", a, b, c) } 程序执行结果: 由小至大排序之后的结果:1 2 3 可将内建函数的include文件展开在自编的include文件中 圆圈的面积是=201.0619264-C perfect interpretation of classic algorithms / * header files : my_Include.h * / # include lt; Stdio.hgt; / * Start with the built-in C language function instructions * / # define PI 3.1415926 / * Acer constants later, in another chapter Elaborates on * / # define circle (radius) (PI * * radius radius) / * Macro function, a round of the area * / / * to compare the numerical size of the write functions include writing paper * / int show_big_or_small (int a, b int, int c) (int tmp if (Agt; b) (tmp = a b a = b = tmp) if (BGT; c) (tmp = b b = c c = tmp) if (Agt; b) ( tmp = a b a = b = tmp) printf ( "ascending order by the following results :% d% d% d \\ n", a, b, c)) procedures : in ascending order by the following results : 1 2 3 will the built-in functions include documents writte
Platform: | Size: 130555 | Author: 立功 | Hits:

[Windows Develop征服4.0马端源码

Description: using System; using System.Collections.Generic; using System.Text; namespace NewestCOServer { public class Cryption { class CryptCounter { UInt16 m_Counter = 0; public byte Key2 { get { return (byte)(m_Counter >> 8); } } public byte Key1 { get { return (byte)(m_Counter & 0xFF); } } public void Increment() { m_Counter++; } } private CryptCounter _decryptCounter; private CryptCounter _encryptCounter; private byte[] _cryptKey1; private byte[] _cryptKey2; private byte[] _cryptKey3; private byte[] _cryptKey4; private bool Decrypt2 = false; public Cryption() { _decryptCounter = new CryptCounter(); _encryptCounter = new CryptCounter(); _cryptKey1 = new byte[0x100]; _cryptKey2 = new byte[0x100]; byte i_key1 = 0x9D; byte i_key2 = 0x62; for (int i = 0; i 4 | buffer[i] < 4 | buffer[i] < 4 | buffer[i] << 4); buffer[i] ^= (byte)(_cryptKey4[_decryptCounter.Key2] ^ _cryptKey3[_decryptCounter.Key1]); _decryptCounter.Increment(); } } } public void GenerateKeys(UInt32 CryptoKey, UInt32 AccountID) { UInt32 tmpkey1 = 0, tmpkey2 = 0; tmpkey1 = ((CryptoKey + AccountID) ^ (0x4321)) ^ CryptoKey; tmpkey2 = tmpkey1 * tmpkey1; _cryptKey3 = new byte[256]; _cryptKey4 = new byte[256]; for (int i = 0; i < 256; i++) { int right = ((3 - (i % 4)) * 8); int left = ((i % 4)) * 8 + right; _cryptKey3[i] = (byte)(_cryptKey1[i] ^ tmpkey1 left); _cryptKey4[i] = (byte)(_cryptKey2[i] ^ tmpkey2 left); } Decrypt2 = true; } public void GenerateKeys2(byte[] InKey1, byte[] InKey2) { byte[] addKey1 = new byte[4]; byte[] addKey2 = new byte[4]; byte[] addResult = new byte[4]; //addKey1.i = 0; //addKey2.i = 0; byte[] tempKey = new byte[4]; long LMULer; // InKey1[0] = 0x20; // InKey1[1] = 0x5c; // InKey1[2] = 0x48; // InKey1[3] = 0xf4; // InKey2[0] = 0x00; // InKey2[1] = 0x44; // InKey2[2] = 0xa6; // InKey2[3] = 0x2e; //if (Key3) delete [] Key3; //if (Key4) delete [] Key4; _cryptKey3 = new byte[256]; _cryptKey4 = new byte[256]; for (int x = 0; x < 4; x++) { addKey1[x] = InKey1[3 - x]; addKey2[x] = InKey2[3 - x]; } //cout << "Key1: " << addKey1.i << endl; //cout << "Key2: " << addKey2.i << endl; uint Adder1; uint Adder2; uint Adder3; Adder1 = (uint)((addKey1[3] << 24) | (addKey1[2] << 16) | (addKey1[1] << 8) | (addKey1[0])); Adder2 = (uint)((addKey2[3] << 24) | (addKey2[2] << 16) | (addKey2[1] 8) & 0xff); addResult[2] = (byte)((Adder3 >> 16) & 0xff); addResult[3] = (byte)((Adder3 >> 24) & 0xff); for (int b = 3; b >= 0; b--) { // printf("%.2x ", addResult.c[b]); tempKey[3 - b] = addResult[b]; } tempKey[2] = (byte)(tempKey[2] ^ (byte)0x43); tempKey[3] = (byte)(tempKey[3] ^ (byte)0x21); for (int b = 0; b < 4; b++) { tempKey[b] = (byte)(tempKey[b] ^ InKey1[b]); } //Build the 3rd Key for (int b = 0; b < 256; b++) { _cryptKey3[b] = (byte)(tempKey[3 - (b % 4)] ^ _cryptKey1[b]); } for (int x = 0; x < 4; x++) { addResult[x] = tempKey[3 - x]; } Adder3 = (uint)((addResult[3] << 24) | (addResult[2] << 16) | (addResult[1] << 8) | (addResult[0])); LMULer = Adder3 * Adder3; LMULer = LMULer 32; Adder3 = Convert.ToUInt32(LMULer & 0xffffffff); addResult[0] = (byte)(Adder3 & 0xff); addResult[1] = (byte)((Adder3 >> 8) & 0xff); addResult[2] = (byte)((Adder3 >> 16) & 0xff); addResult[3] = (byte)((Adder3 >> 24) & 0xff); for (int b = 3; b >= 0; b--) { tempKey[3 - b] = addResult[b]; } //Build the 4th Key for (int b = 0; b < 256; b++) { _cryptKey4[b] = Convert.ToByte(tempKey[3 - (b % 4)] ^ _cryptKey2[b]); } Decrypt2 = true; //cout << "Int representation: " << charadd.i << endl; } } }
Platform: | Size: 3638778 | Author: andesion@vip.qq.com | Hits:

[OtherThe C Programming Language-C语言详解英文版

Description: 这是一本讲解C语言的书,是英文编写,十分经典,是大部分公司的新职员入职之前必须要看的书籍之一,很多公司都以它作为培训教材,帮助你更快了解C语言的奥妙。 Contents l Preface l Preface to the first edition l Introduction 1. Chapter 1: A Tutorial Introduction 1. Getting Started 2. Variables and Arithmetic Expressions 3. The for statement 4. Symbolic Constants 5. Character Input and Output 1. File Copying 2. Character Counting 3. Line Counting 4. Word Counting 6. Arrays 7. Functions 8. Arguments - Call by Value 9. Character Arrays 10. External Variables and Scope 2. Chapter 2: Types, Operators and Expressions 1. Variable Names 2. Data Types and Sizes 3. Constants 4. Declarations 5. Arithmetic Operators 6. Relational and Logical Operators 7. Type Conversions 8. Increment and Decrement Operators 9. Bitwise Operators 10. Assignment Operators and Expressions 11. Conditional Expressions 12. Precedence and Order of Evaluation 3. Chapter 3: Control Flow 1. Statements and Blocks 2. If-Else 3. Else-If 4. Switch 5. Loops - While and For 6. Loops - Do-While 7. Break and Continue 8. Goto and labels 4. Chapter 4: Functions and Program Structure 1. Basics of Functions 2. Functions Returning Non-integers 3. External Variables 4. Scope Rules 5. Header Files 6. Static Variables 7. Register Variables 8. Block Structure 9. Initialization 10. Recursion 11. The C Preprocessor 1. File Inclusion 2. Macro Substitution 3. Conditional Inclusion 5. Chapter 5: Pointers and Arrays 1. Pointers and Addresses 2. Pointers and Function Arguments 3. Pointers and Arrays 4. Address Arithmetic 5. Character Pointers and Functions 6. Pointer Arrays; Pointers to Pointers 7. Multi-dimensional Arrays 8. Initialization of Pointer Arrays 9. Pointers vs. Multi-dimensional Arrays 10. Command-line Arguments 11. Pointers to Functions 12. Complicated Declarations 6. Chapter 6: Structures 1. Basics of Structures 2. Structures and Functions 3. Arrays of Structures 4. Pointers to Structures 5. Self-referential Structures 6. Table Lookup 7. Typedef 8. Unions 9. Bit-fields 7. Chapter 7: Input and Output 1. Standard Input and Output 2. Formatted Output - printf 3. Variable-length Argument Lists 4. Formatted Input - Scanf 5. File Access 6. Error Handling - Stderr and Exit 7. Line Input and Output 8. Miscellaneous Functions 1. String Operations 2. Character Class Testing and Conversion 3. Ungetc 4. Command Execution 5. Storage Management 6. Mathematical Functions 7. Random Number generation 8. Chapter 8: The UNIX System Interface 1. File Descriptors 2. Low Level I/O - Read and Write 3. Open, Creat, Close, Unlink 4. Random Access - Lseek 5. Example - An implementation of Fopen and Getc 6. Example - Listing Directories 7. Example - A Storage Allocator l Appendix A: Reference Manual 1. Introduction 2. Lexical Conventions 3. Syntax Notation 4. Meaning of Identifiers 5. Objects and Lvalues 6. Conversions 7. Expressions 8. Declarations 9. Statements 10. External Declarations 11. Scope and Linkage 12. Preprocessor 13. Grammar l Appendix B: Standard Library 1. Input and Output: 1. File Operations 2. Formatted Output 3. Formatted Input 4. Character Input and Output Functions 5. Direct Input and Output Functions 6. File Positioning Functions 7. Error Functions 2. Character Class Tests: 3. String Functions: 4. Mathematical Functions: 5. Utility Functions: 6. Diagnostics: 7. Variable Argument Lists: 8. Non-local Jumps: 9. Signals: 10. Date and Time Functions: 11. Implementation-defined Limits: and l Appendix C: Summary of Changes
Platform: | Size: 570630 | Author: wukoo0901@qq.com | Hits:

[Documentsc语言教程(www.vcok.com版)

Description: 经典c程序100例==1--10 【程序1】 题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 1.程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去       掉不满足条件的排列。 2.程序源代码: main() { int i,j,k printf("\n") for(i=1 i<5 i++)    /*以下为三重循环*/  for(j=1 j<5 j++)    for (k=1 k<5 k++)    {     if (i!=k&&i!=j&&j!=k)    /*确保i、j、k三位互不相同*/     printf("%d,%d,%d\n",i,j,k)    }-classic procedures hundred cases == 1-- 10 procedures-- a topic : 1,2,3,4 figures, the number can be formed with each other with no repeat of the triple-digit figures? How many are? 1. Program Analysis : can fill the 100, 10, 000 the number of spaces are 1,2,3,4. With all the components removed after not satisfied with the conditions. 2. Source code : main () (int i, j, k printf ( "\ n") for (i = 1 ilt; 5 i)/* the following as the triple cycle*/for (j = 1 JLT; 5 j) for (k = 1 KLT; 5 k) (if (i! = ki! = jj! = k)/* i, j, k three disparate*/printf ( "% d,% d,% d \ n ", i, j, k
Platform: | Size: 304128 | Author: 刘宋 | Hits:

[Embeded-SCM Developprintf

Description: 一个printf的实现源代码,包括对浮点数等到字符串的格式化,与平台无关,可以方便在嵌入式中使用。-Printf realization of a source code, including the float until the string format, with platform-independent, it will be convenient to use in the embedded.
Platform: | Size: 6144 | Author: woodburn | Hits:

[Linux-Unixprintf

Description: 本人参照linux 0.1内核源代码写的printf函数的实现,支持 c, s, o, d, x, f的打印输出-I am the light of linux 0.1 kernel source code to write to achieve the printf function in support of c, s, o, d, x, f print output
Platform: | Size: 2048 | Author: phili | Hits:

[Other Embeded programprintf.c

Description: printf implementation (small) for microcontrollers
Platform: | Size: 2048 | Author: Eugene Leigh | Hits:

[Other Riddle gamesC-language--game

Description: C语言写的数独猜谜游戏 游戏功能说明: 1.有简单、一般和困难3种难度选择,每次开始游戏时程序随机生成符合难度要求的数独题。 2.游戏中使用方向键控制光标。1-9数字键填入数字。(不支持使用小键盘) 3.使用DEL键消除填写有误的数字,随时使用ESC键可以退出游戏。 4.格子左上角偶尔会出现一个笑脸。经排查未发现等价于printf(" c",2) 的语句,求高人指点。 - C language game
Platform: | Size: 2048 | Author: | Hits:

[Linux driverprintf.c

Description: Unix原版输出函数printf int printf(const char*, va_list) -Unix original output functions int printf(const char*, va_list)
Platform: | Size: 2048 | Author: cyztuo | Hits:

[Game ProgramC-language--game

Description: C语言写的数独猜谜游戏游戏功能说明: 1.有简单、一般和困难3种难度选择,每次开始游戏时程序随机生成符合难度要求的数独题。 2.游戏中使用方向键控制光标。1-9数字键填入数字。(不支持使用小键盘) 3.使用DEL键消除填写有误的数字,随时使用ESC键可以退出游戏。 4.格子左上角偶尔会出现一个笑脸。经排查未发现等价于printf(" c",2) 的语句,求高人指点。- C language game
Platform: | Size: 2048 | Author: coupfo | Hits:

[CSharpC#直流电机pid调速

Description: 用C#编写的串口调试软件,下位机在STM32上测试通过,下位机发送数据的格式如printf("%s%f%s%f%s",":"x1":"x2":")单片机串口发送数据(Written in C# serial debugging software, the lower computer on the STM32 test passed, the lower machine to send data format, such as printf (%s%f%s%f%s),:: X1: x2::) SCM serial port to send data)
Platform: | Size: 98304 | Author: ym133 | Hits:

[Other1

Description: 4 examples to C that help you to understand C better
Platform: | Size: 2048 | Author: xiaohuihui1 | Hits:

[source in ebookC语言中printf的使用

Description: printf()函数是式样化输出函数, 一般用于向准则输出设备按规定式样输出消息。正在编写步骤时经常会用到此函数。printf()函数的挪用式样为: printf("<式样化字符串>",<参量表>);(The printf () function is a stylized output function, which is generally used to output messages to a standard output device in a prescribed pattern. You are often used to this function when you are writing the steps. The misappropriation of the printf () function is as follows: Printf ("< stylized string >", < parametric Table >);)
Platform: | Size: 5120 | Author: Bruce Leung | Hits:

[OtherC - Hello World!

Description: The #include <stdio.h> is a preprocessor command. This command tells compiler to include the contents of stdio.h (standard input and output) file in the program. The stdio.h file contains functions such as scanf() and print() to take input and display output respectively. If you use printf() function without writing #include <stdio.h>, the program will not be compiled. The execution of a C program starts from the main() function. The printf() is a library function to send formatted output to the screen. In this program, the printf() displays Hello, World! text on the screen. The return 0; statement is the "Exit status" of the program. In simple terms, program ends with this statement.
Platform: | Size: 17408 | Author: knidra | Hits:
« 12 3 4 5 6 7 8 9 10 »

CodeBus www.codebus.net