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

Search list

[Documents我们如何从VC++开始“编程”

Description: 不管学C还是学C++,VC和gcc都可以,甚至,什么其他C语言编译器,也可以啊,Intel的C,以前DOS下的turbo C/C++,Watcom C/C++,都可以,我首先摆句话,C和C++是语言,既然是语言,就与操作系统无关,那些printf,scanf,甚至包括什么对话框,MassageBox,消息循环,都不重要,因为这不是语言特性,初学者,暂时先不必管。
Platform: | Size: 52736 | Author: crayonlinew | Hits:

[SourceCode人工智能

Description: printf("题目:设有n个传教士和m个野人来到河边,打算乘一只船从右岸到左岸去。\n"); printf("该船的负载能力为两人。在任何时候,如果野人人数超过传教士人数,野人\n"); printf("就会把传教士吃掉。他们怎样才能用这条船安全的把所有人都渡过河去?\n"); printf("\n默认的n、m值皆为3\n");
Platform: | Size: 9936 | Author: 436048090@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:

[SourceCodeusart_printf

Description: stm32f103vct6的串口打印功能程序
Platform: | Size: 1134238 | Author: yxg.ok@hotmail.com | Hits:

[SourceCodezuijiasuanfa

Description: #include #include #define M 20 #define N 3 int mm[M]={0,0,0,2,3,1,0,4,2,3,2,1,0,3,2,2,1,3,0,1}; int nn[N]; int number; void Xunhuan(void); void FIFO(void); void Best(void); void LRU(void); int main() { char ss[1]; int i,j, *p=nn; int c, k=0; for(i=0;i
Platform: | Size: 2853 | Author: lipman1987 | Hits:

[SourceCodecaculator

Description: // caculator.cpp : Defines the entry point for the console application. // #include #include #include #include #include char e; int main(int argc, char *argv[]) { do { float a,c,d; char b; printf("input first number\n"); scanf("%f",&a); printf("input operator\n"); getchar(); scanf("%c",&b); printf("input the second number\n"); scanf("%f",&c); switch(b) { case'+':d=a+c;break; case'-':d=a-c;break; case'*':d=a*c;break; case'%':if(c==0) { printf("error\n"); break;} else d=a/c;break; case'^':d=pow(a,c);break; default:printf("error\n"); } printf("%f\n",d); printf("do you want to continue y/n\n"); getchar(); scanf("%c",&e);} while(e=='y'); return 0; }
Platform: | Size: 875 | Author: fmrnn@sina.com | Hits:

[CSharp迷宫求解的非递归算法

Description: #include #include #include #define N 20 int aa[N][N]; int yes=0; int x[100][2],n=0; void fun1(int (*aa)[N],int (*a)[N]); int fun(int (*a)[N],int i,int j); void begain(int (*t)[N]); void pr(int (*t)[N],int nn); void win(int (*t)[N]); void lose(); void main(void) { int t[N][N]; begain(t); pr(t,0); fun(t,1,1); if(yes) win(t); else lose(); getch(); } void fun1(int (*aa)[N],int (*a)[N]) { int i,j; for(i=0;i<N;i++) for(j=0;j<N;j++) aa[i][j]=a[i][j]; } int fun(int (*a)[N],int i,int j) { if(i==N-2&&j==N-2) { yes=1; return; } a[i][j]=1; fun1(aa,a); if(aa[i+1][j+1]==0&&!yes) { fun(aa,i+1,j+1); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } fun1(aa,a); if(aa[i+1][j]==0&&!yes) { fun(aa,i+1,j); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } fun1(aa,a); if(aa[i][j+1]==0&&!yes) { fun(aa,i,j+1); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } fun1(aa,a); if(aa[i-1][j]==0&&!yes) { fun(aa,i-1,j); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } fun1(aa,a); if(aa[i-1][j+1]==0&&!yes) { fun(aa,i-1,j+1); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } fun1(aa,a); if(aa[i+1][j-1]==0&&!yes) { fun(aa,i+1,j-1); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } fun1(aa,a); if(aa[i][j-1]==0&&!yes) { fun(aa,i,j-1); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } fun1(aa,a); if(aa[i-1][j-1]==0&&!yes) { fun(aa,i-1,j-1); if(yes) {x[n][0]=i,x[n++][1]=j;return;} } } void begain(int (*t)[N]) { int i,j; system(cls); randomize(); for(i=0;i<N;i++) { for(j=0;j<N;j++) { if(i==0||i==N-1||j==0||j==N-1) t[i][j]=1; else if(i==1&&j==1||i==N-2&&j==N-2) t[i][j]=0; else t[i][j]=random(2); } } } void pr(int (*t)[N],int nn) { int i,j,ii; textcolor(RED); gotoxy(1,1); for(i=0;i<N;i++) { for(j=0;j<N;j++) { if(nn!=1) printf(%2d,t[i][j]); else { for(ii=0;ii<n;ii++) { if(x[ii][0]==i&&x[ii][1]==j) { cprintf(%2d,t[i][j]); break; } } if(ii<n) continue; if(i==N-2&&j==N-2) cprintf( 0); else printf(%2d,t[i][j]); } } printf(\n); } } void win(int (*t)[N]) { int i,j,ii,jj; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(x[j][0]==x[i][0]&&x[j][1]==x[i][1]) { for(jj=j,ii=i;jj=0;i--) printf(%3d%3d->,x[i][0],x[i][1]); printf(%3d%3d\n,N-2,N-2); t[1][1]=0; pr(t,1); } void lose() { printf(\nNot find way!\n); }
Platform: | Size: 854 | Author: 461600486@qq.com | Hits:

[File Format字符窗口开发包

Description: 窗口类CBufferWnd:能够作为子窗口或者时弹出窗口支持滚动,自动根据滚动位置调整显示的内容支持光标显示在光标处或是指定位置插入文字输出辅助类CConsoler:与指定的输出窗口对象进行绑定能够支持printf方式的输出能够对汉字进行处理避免出现换行时出现半个汉字的情况,在半个汉字时利用空格进行替换,并在下一行继续显示文字利用字符窗口可以方便的开发类似与控-CBufferWnd window class : to act as sub-window, or when the pop-up window support rolling, rolling under the automatic adjustment position that the content in support of the cursor shows the cursor or a designated location to insert language supporting category CConsoler output : the output window specified targets for bonding to support printf way to the output treatment of Chinese characters to avoid moving there for half of the Chinese characters, half a box of Chinese characters when using Replacement, and the next, and his party continue to show characters using text window can facilitate the development of similar and control
Platform: | Size: 61440 | Author: 杜宇 | Hits:

[Chess Poker gamesCardTest1

Description: 游戏说明: 牌的大小顺序: 大王,小王,A,K,Q,j,9,8,7,6,5,4,3,2 出牌规则: 每次只能出一张牌,每局开始时随机由其中一人先出牌,以后由上一次赢的玩家出牌。首家可以出任意一张牌。首家出牌后,下家所出的牌的花色要与首家的相同,大小不限。如确实没有花色相同的牌,则可以出其它的牌。 胜负判定: 当每人都出了一张牌后,如果花色相同,则比较两张牌的大小,牌大的赢.如果花色不同,则先出牌的赢。最后经过统计赢的次数最多的 玩家最终赢得比赛。 The rules is following: 1) The Cards RANK (big to small) is: A K Q J 10 9 8 7 6 5 4 3 2 2) Once only can play one Card,if the suit is same and the Rank is big,they win or lost if you no the suit ,you must play any card but your s always small, 3) Now i think you know the rules ! Goog Luck ! printf("Please choice your cards Color: 0 means spade 1 means hearts 2 means diamonds 3 means clubs :\n") -games : licensing the order : King, Wang, A, K, Q, j, 9,8,7,6,5,4,3,2 out licensing rules : each time out only one card, at the beginning of each Board random by one of the first to be out later last won by the player card. The first to be sent to an arbitrary license. The first card, the home under the license by the first matched with the same open-size. If they really do not matched the same card, can produce other card. The results found : When everyone out of a license, if the same colors, compared to the size of two licenses, the licenses won. If the colors were different, first-out licensing of winning. After winning the final statistics of the number of players up to the final whistle. The rules is following : 1) The Cards RANK (big to small) is : A K Q J 10 9 8 7 6 5 4 3 2 2) Once
Platform: | Size: 5120 | 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: 1024 | 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: 15360 | Author: gjc | 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:

[VC/MFCC++完美演绎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: 130048 | Author: 立功 | Hits:

[Static controler

Description: Java 天生的一些优势外,他最大的魅力在於它提供的应用程式程式设 计介面 (API, Application Programming Interface),什麼是 API 呢 所谓 API 是指作业环境所提供给程式设计者用来使唤系统,程式库或是元件的函式 呼叫或资料结构,换言之,就是作业系统或作业环境提供给应用程式与系 统核心沟通的介面,像:ANSI C 中规定的 printf 就是用来向标准输出输出 文字用的函数呼叫.所以,只要知道 Java 提供了哪些类别可供使用,就可 以轻易的设计 Java 程式.-Java born some advantage, his greatest charm is that it provides applications programming interface (API Application Programming Interface) and what is so-called? API API is provided by the operating environment to the programs used to manage system designers, programmers or components for the call or data abstraction the structure, in other words, is the operating system or operating environment for application programs to communicate with the core system, the interface as : ANSI C is the printf to output to standard output using the text function call. Therefore, as long as the Java know what types available, it can light the easy design of Java programs.
Platform: | Size: 7168 | Author: zc | Hits:

[Internet-NetworkYCArray

Description: /** * 动态数组的模板类 * 1.支持字符索引 * 2.方便的添加删除修改任意一项 * 最后更新 2004-8-9 yzh **1.优化了字符索引的运作方式,使用数组存储 **2.重写了底层数据的存储,将连续性的存储方式改为了非连续, *** 从而很好有效地支持了“引用”,并且让数据的删除增加变的更为快速 * 用法如: * YCArray<int,int> test * test.Add("Number2",4) * test.Add("Number1",2) * printf("%d %d",test["Number1"],test["Number2"]) * 显示: * 2 4 ******* ******* History: 2004-11-19 修改了析构函数,解决了索引没有释放的bug **/-/*** dynamic array template class* 1. Support characters Index* 2. Add convenience to delete arbitrary* a final update 2004-8-9 yzh** 1. Character Index optimized mode of operation, the use of storage arrays** 2 . a rewrite of the underlying data storage, storage continuity conversion of non-continuous, and thus good*** effective support to the "quote", and let the data changed to delete the more rapid* usage such as :* YCArraylt; int, intgt; test* test. Add ( "Number2", 4)* test.Add ( "Number1", 2)* printf ( "% d% d", test [ "Number1"] test [ "Number2"])* Display :** 2 4************* History : 2004-11-19 revised the destructors, the index did not address the release of bug** /
Platform: | Size: 5120 | Author: 叶振华 | Hits:

[GUI Develop简单日志

Description: 你在写程序中是否要经常输出信息作为观察你的程序是否正常运行的标记. 本程序给你一个可以在Windows中用printf功能的函数log_printf,当然有更多的功能啦,自己看看就知道啦-you write procedures should always output information as you observe the procedures for normal operation markings. This program can give you a Windows function using printf function log_printf, of course, have more functions-- and see for yourself know--
Platform: | Size: 736256 | Author: 罗清胜 | Hits:

[ActiveX/DCOM/ATLTrace_dll

Description: Trace跟踪动态库,文件读写,支持如printf函数的一样参数-Trace DLL tracking, document literacy, such as support functions like printf parameters
Platform: | Size: 11264 | Author: 乔文杰 | Hits:

[Embeded Linuxc环境下的编译器

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: 6144 | Author: 韩天毅 | Hits:

[Other三星S344B0X蜂鸣器测试

Description: 三星S344B0X蜂鸣器测试 // if(key== + ) // if(BeepFreq<20000) // BeepFreq += 100 // if(key== - ) // if(BeepFreq>100) // BeepFreq -=100 // SetBeepPwm(BeepFreq, 50) // printf("Now beep frequence is %d\n", BeepFreq) // Delay(2000000) // StopBeepPwm() -Samsung S344B0X buzzer testing// if (key ==)// if (BeepFreqlt; 20000)// BeepFreq = 100// if (key ==-)// if (BeepFreqgt; 100)// BeepFreq-= 100// SetBeepPwm (BeepFreq, 50)// printf ( "Now beep frequence is% d \ n", BeepFreq)// Delay (2000000)// StopBeepPwm ()
Platform: | Size: 77824 | Author: kong | Hits:

[SCMgnu_iodemo

Description: UART I/O and Memory Allocation Example for GNU The project GNU_IODemo shows how to use memory allocation routines (malloc) and char I/O (printf, scanf) via a serial interface with the GNU toolchain. The I/O functions are adapted for the Analog Devices ADuC7000 series using the SERIAL.C module. The example also shows the efficiency of the Keil CA ARM Compiler run-time library which is tuned for single chip systems.-UART I/O and Memory Allocation for Example The GNU project GNU_IODemo shows how to use memo ry allocation routines (malloc) and char I/O (p rintf. Scanf) via a serial interface with the GNU toolc DERA. The I/O functions are adapted for the Anal og Devices ADuC7000 series using the SERIAL.C m odule. The example also shows the efficiency of the Keil CA ARM Compiler run-time library which is tuned for single chip systems.
Platform: | Size: 43008 | Author: 郭文彬 | Hits:
« 1 2 ... 5 6 7 8 9 1011 12 13 14 15 ... 38 »

CodeBus www.codebus.net