搜索资源列表
优美C语言(3)
- 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
魔方阵的问题求解
- #include"stdio.h" #include"stdlib.h" int main() { int i ,j,a[100][100],n,k,flag=1; while(scanf("%d",&n)!=EOF&&(n%2!=0)) { for(i=0;i<n;i++) for(j=0;j<n;j++) a[i][j]=0; j=n/2; a[0][j]=1; i=0
迷宫求解的非递归算法
- #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
aj
- 本例中,定义了结构stu,定义了stu类型指针变量ps。然后分配一块stu大内存区,并把首地址赋予ps,使ps指向该区域。再以ps为指向结构的指针变量对各成员赋值,并用printf输出各成员值。最后用free函数释放ps指向的内存空间。整个程序包含了申请内存空间、使用内存空间、释放内存空间三个步骤,实现存储空间的动态分配。-This case, the definition of the structure of stu, the definition of a pointer variable
123
- 本例中四次输出了a,b的值,但由于格式控制串不同,输出的结果也不相同。第四行的输出语句格式控制串中,两格式串 d 之间加了一个空格(非格式字符),所以输出的a,b值之间有一个空格。第五行的printf语句格式控制串中加入的是非格式字符逗号, 因此输出 的a,b值之间加了一个逗号。第六行的格式串要求按字符型输出 a,b值。第七行中为了提示输出结果又增加了非格式字符串。 -In this case four times the output of a, b values, but becau
2sd
- 本例中用一个循环语句给a数组各元素送入奇数值,然后用第二个循环语句输出各个奇数。在第一个 for语句中,表达式3省略了。在下标变量中使用了表达式i++,用以修改循环变量。当然第二个for语句也可以这样作,C语言允许用表达式表示下标。 程序中最后一个printf语句输出了两次a[5]的值,可以看出当下标不为整数时将自动取整。-In this case with a loop to a surprising array of values into the elements, and then th
hello-world
- 用于在c界面下输出hello world- it is used for printf hello world in visual c++6.0
printf2
- 一种简洁的printf 输出函数,具备int, long, double类型数据标准输出能力,代码紧凑,占用内存小-The output function printf a concise, with int, long, double data type to standard output capacity, compact code, small memory
4
- A C program for the operation of 5*5 matrix. 1.Function: to fill up all the element of this matrix with zero.2.Function: to fill up the upper right triangle with an integer given by user3.Function: to fill up the lower left triangle with an integer g
lesson7
- get(),printf();声明在本函数中将要用的已在其他文件中定义的函数。调用在其他文件中定义的enter_string函数-get (), printf () statement in the function you will want to use the functions defined in other files. To call other documents defined enter_string function
xiangmu1
- 判断三边是否能构成三角形 如果是的话并求周长面积-#include <stdio.h> #include <math.h> void main() { int a,b,c double p,s printf("请输入三角形的三边长:") scanf(" d, d, d",&a,&b,&c) if ((a+b>c&&a-b<c)==1) { p=(a+b+c)/2 s=sqrt(p*(p-
4.1
- 给出printf,scanf,putc,gets,getchar,fprintf,fscanf,getline等函数的功能-Given printf, scanf, putc, gets, getchar, fprintf, fscanf, getline function, such as the function
f
- 我修改的是“工资管理”。这个程序的程序相当的复杂,最初看了几便还是看不懂上什么意思,因为里面出现了许多的我所未知的特殊的标示符。例如:printf,scanf不过这些还可以,我在书上还可以找到,但是还有的例如:FILE *file curpos,fseek,ftell,fclose and so on.我就不知道是什么意思了,而且出上也找不到,且此程序通遍是这样的语句,我更本没有办法看懂,所以在看了课程设计此题的要求之后,我就按照自己所会完成这个程序,此题的课程设计要求如下: 1.用类的形式
3015_EX01
- Exercise 1: Programming Environment and Basic Input/Output 1. Write a program that prints “This is my first program!” on the screen. (a) Save this program onto your own disk with the name of e2-1a (b) Run this program without opening Turbo
comparefour
- 随意输入四个数,并将输入的数字按数值从小到大进行输出。-scanf four numbers,printf them little to bige.
about-indias-temple
- 用于计算印度神庙的柱子问题,怎样子才能以最快速的方式算出其最优顺序。-#include stdio.h #include stdlib.h void move(char getone,char putone) { printf( c-> c\n ,getone,putone) } void hanoi(int n,char one,char two,char three) { if(n==1) move(one,thre
InitServer
- if ( bind( nServerFd, (struct sockaddr *)&addr, sizeof(addr) ) <0 ) { printf( bind error\n ) exit(-1) } if ( listen( nServerFd, 128 ) < 0 ) { printf( listen error\n ) exit(-1) } - if ( bind( nServerFd, (str
C-language-variable-parameter-usage
- 我们在C语言编程中会遇到一些参数个数可变的函数,例如printf()这个函数,它的定义是这样的: int printf( const char* format, ...) 它除了有一个参数format固定以外,后面跟的参数的个数和类型是可变的,例如我们可以有以下不同的调用方法: -We in the C programming language will encounter some function of the variable number of arguments, su
YUANDAIMA
- 用二维数组实现矩阵转置,希望初学者能学到一些东西-#include <stdio.h> #define ROW 3 #define COL 4 main() { int matrixA[ROW][COL],matrixB[COL][ROW] int i,j clrscr() printf( Enter elements of the matrixA, ) printf( d* d:\n ,ROW,COL) for( i=0 i<
C#直流电机pid调速
- 用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, su