C语言
-
C示例自顶向下三角形打印-C语言实例教程|
C示例自顶向下三角形打印 #include stdio.h int main () { int n , i , j ; n = 5 ; for ( i = 0 ; i n ; i ++ ) { for ( j = 0 ; j i ; j ++ ) printf ( ); for ( j = i ; j n ; j +...
-
C语言fgets函数-C语言基础教程实例源码|
C语言fgets函数 /* fgets3.c -- using fgets() */ #include stdio.h #define STLEN 10 int main ( void ) { char words [ STLEN ]; int i ; puts ( Enter strings (empty line to quit): ); ...
-
C语言gets和puts函数-C语言基础教程实例源码|
C语言gets和puts函数 /* getsputs.c -- using gets() and puts() */ #include stdio.h #define STLEN 81 int main ( void ) { char words [ STLEN ]; puts ( Enter a string, please. ); ge...
-
C示例颠倒三角形-C语言实例教程|
C示例颠倒三角形 #include stdio.h int main () { int n , i , j ; n = 5 ; for ( i = 1 ; i = n ; i ++ ) { for ( j = 1 ; j i ; j ++ ) printf ( ); for ( j = i ; j = n ; j ++ ) prin...
-
C语言指针和字符串-C语言基础教程实例源码|
C语言指针和字符串 /* p_and_s.c -- pointers and strings */ #include stdio.h int main ( void ) { const char * mesg = Dont be a fool! ; const char * copy ; copy = mesg ; printf...
-
C示例右三角打印-C语言实例教程|
C示例右三角打印 #include stdio.h int main () { int n , i , j ; n = 5 ; for ( i = 1 ; i = n ; i ++ ) { for ( j = 1 ; j = i ; j ++ ) printf ( * ); printf ( ); } return 0 ; }...
-
C语言字符串数组-C语言基础教程实例源码|
C语言字符串数组 // arrchar.c -- array of pointers, array of strings #include stdio.h #define SLEN 40 #define LIM 5 int main ( void ) { const char * mytalents [ LIM ] = { Addi...
-
C示例等边三角形-C语言实例教程|
C示例等边三角形 #include stdio.h int main () { int n , i , j ; n = 5 ; // number of rows. for ( i = 1 ; i = n ; i ++ ) { for ( j = 1 ; j = n - i ; j ++ ) printf ( ); for ( j ...
-
C语言字符串的地址-C语言基础教程实例源码|
C语言字符串的地址 // addresses.c -- addresses of strings #define MSG Im special. #include stdio.h int main () { char ar [] = MSG ; const char * pt = MSG ; printf ( address o...
-
C实例打印奇数值-C语言实例教程|
C实例 打印奇数值 #include stdio.h int main () { int i ; for ( i = 1 ; i = 10 ; i ++ ) { if ( i % 2 != 0 ) printf ( %d , i ); } return 0 ; }...
-
C语言使用指针操作字符串实例-C语言基础教程实例源码|
C语言使用指针操作字符串实例 /* strptr.c -- strings as pointers */ #include stdio.h int main ( void ) { printf ( %s, %p, %c , We , are , * space farers ); return 0 ; }...
-
C实例打印偶数值-C语言实例教程|
C实例 打印偶数值 #include stdio.h int main () { int i ; for ( i = 1 ; i = 10 ; i ++ ) { if ( i % 2 == 0 ) printf ( %2d , i ); } return 0 ; }...
-
C语言表示字符串的几种方式-C语言基础教程实例源码|
C语言表示字符串的几种方式 // strings1.c #include stdio.h #define MSG I am a symbolic string constant. #define MAXLENGTH 81 int main ( void ) { char words [ MAXLENGTH ] =...
-
C实例反向计数程序-C语言实例教程|
C实例 反向计数程序 #include stdio.h int main () { int i , start , end ; start = 1 ; end = 10 ; //reverse counting, well interchange loop variables for ( i = end ; i = start ...
-
C语言更改程序变量-C语言基础教程实例源码|
C语言更改程序变量 /* swap2.c -- researching swap1.c */ #include stdio.h void interchange ( int u , int v ); int main ( void ) { int x = 5 , y = 10 ; printf ( Originally x = ...
-
C实例嵌套表-C语言实例教程|
C实例 嵌套表 #include stdio.h int main () { int i , j , count ; int start , end ; start = 2 , end = 10 ; for ( i = start ; i = end ; i ++ ) { count = i ; for ( j = 1 ; j = 10 ;...
-
C实例表实现-C语言实例教程|
C实例 表实现 #include stdio.h int main () { int i , j , n ; n = 3 ; j = 1 ; for ( i = n ; i = ( n * 10 ); i += n ) { printf ( %3d x %2d = %3d , n , j , i ); j ++ ; } return 0 ;...
-
C实例C示例表计数程序-C语言实例教程|
C实例 C示例表计数程序 #include stdio.h int main () { int i , j , count ; for ( i = 1 ; i = 10 ; i ++ ) { for ( j = i ; j = 100 ; j += 10 ) printf ( %3d , j ); printf ( ); }...
-
C实例计数程序-C语言实例教程|
C实例 计数程序 #include stdio.h int main () { int i , start , end ; start = 1 ; end = 10 ; for ( i = start ; i = end ; i ++ ) printf ( %2d , i ); return 0 ; }...
-
C语言更改变量-C语言基础教程实例源码|
C语言更改变量 /* swap1.c -- first attempt at a swapping function */ #include stdio.h void interchange ( int u , int v ); /* declare function */ int main ( void ) { int x = 5 ,...