摘要:
#include <stdio.h>#include <string.h>// 冒泡排序void popo(char *str[] ,int len);void popo(char *str[] ,int len){ for (int i = 0; i< len - 1; i++) { for (char **m = str; m < str + (len - 1 - i); m++) { if (strcmp(*m, *(m+1)) > 0) { char *tmp = *m; *m = *(m+1); *(m+1... 阅读全文
posted @ 2013-02-27 17:39
沉默的影子
阅读(189)
评论(0)
推荐(0)
摘要:
#include <stdio.h>#include <stdbool.h>#include <stdlib.h>#include <time.h>struct Year{ int year; int month; int day;};bool leapYear(int aYear);bool leapYear(int aYear){ bool s = false; if (( aYear % 4 == 0 && aYear % 100 !=0)||(aYear % 400 == 0)) { s = true; } return 阅读全文
posted @ 2013-02-27 17:38
沉默的影子
阅读(169)
评论(0)
推荐(0)
摘要:
#include <stdio.h>#include <stdbool.h>bool leapYear(int year);int maxCommonDivisor(int n1,int n2);int main(int argc, const char * argv[]){ // 求三个数最大值 int a = 12,b = 11,c = 9; int max = a; if (max < b) { max = b; } if (max < c) { max = c; } printf("max = %d",max); // 2、 in 阅读全文
posted @ 2013-02-27 17:37
沉默的影子
阅读(128)
评论(0)
推荐(0)
摘要:
#include <stdio.h>#define count 100#define max(a,b) (a>b) ? a : b// 函数的声明int getMax(int a,int b);void print(void);// 定义一个枚举enum weekday{ monday = 0, tuesday, wednesday, thusday, friday};int main(int argc, const char * argv[]){ int a = 10,b = 11; // 一级指针 int *p = &a; int *q = &b; // 阅读全文
posted @ 2013-02-27 17:36
沉默的影子
阅读(135)
评论(0)
推荐(0)
摘要:
#include <stdio.h>#include <string.h>#include <stdlib.h>int main(int argc, const char * argv[]){ int arr[] = {147258}; // 数组元素的个数 int len = sizeof(arr) / sizeof(arr[0]); for (int i = 0; i < len; i++) { printf("%d ",arr[i]); } printf("\n"); // 声明指针变量 int *p = 阅读全文
posted @ 2013-02-27 17:35
沉默的影子
阅读(122)
评论(0)
推荐(0)
摘要:
#include <stdio.h>void changValue1(int x,int y);void changValue1(int x,int y){ int tmp = 0; tmp = x; x = y; y = tmp;}void changValue2(int *x,int *y);void changValue2(int *x,int *y){ int tmp = 0; tmp = *x; *x = *y; *y = tmp;}// 多返回值的函数int calc(int a,int b,int *c);int calc(int a,int b,int *c){.. 阅读全文
posted @ 2013-02-27 17:34
沉默的影子
阅读(139)
评论(0)
推荐(0)
摘要:
#include <stdio.h>#include <stdlib.h>#include <time.h>#include <stdbool.h>#include "util.h"bool fun(int param);int main(int argc, const char * argv[]){ int a = 10,b = 11; int sum; sum = sumNum(a, b); printf("SUM = %d",sum); // 随机数的产生 int r = 0; // 随机数的种子 s 阅读全文
posted @ 2013-02-27 17:33
沉默的影子
阅读(110)
评论(0)
推荐(0)
摘要:
#include <stdio.h>int main(int argc, const char * argv[]){ // 控制台输入 int a,b; scanf("%d,%d",&a,&b); // 条件分支--if int max; if (a>0 && b>0) { if (a>b) { max = a; } else { max = b; } } else if(a>0&&b<0) { max = a; } else if(a<0&& b>0) { 阅读全文
posted @ 2013-02-27 17:31
沉默的影子
阅读(222)
评论(0)
推荐(0)
摘要:
#include <stdio.h>#define PI 3.1415926#define IOS_Screen_Width 320.0int main(int argc, const char * argv[]){ int r = 10; double cycle = r * r * PI; printf("%f",cycle); /* int a = 1; int b = 1; int c = 2; a = a + b + c; //printf("d = %d",d); */ float e,f; e = 0.1f; f = 0.2f; 阅读全文
posted @ 2013-02-27 17:30
沉默的影子
阅读(189)
评论(0)
推荐(0)
浙公网安备 33010602011771号