C
Sail__
Today I get through with nothing done is just the tomorrow the men who dead yesterday eager for.
展开
-
一个H行L列的二维矩阵数组(整形),求每行的元素总和,并输出最大的那一行的总和
#include "stdio.h"#define H 5#define L 10int total(int *p,int n){ int all = 0; for(int i =0;i<n;i++) { all = all + p[i]; } return all;}void main(){ int arr[H][L] = {0}; int plus[H] =原创 2013-11-28 18:13:00 · 1413 阅读 · 0 评论 -
矩阵排序,四角最小,中心最大
#include "stdio.h"#define MAX 25void swap(int *a,int *b){ int t; t = *a; *a = *b; *b = t;}void main(){ int a[MAX]; int temp; printf("请输入25个数字\n"); for(int k = 0;k < MAX; k++ ) { scanf原创 2013-11-27 18:42:57 · 1093 阅读 · 0 评论 -
一个H行L列的二维矩阵数组(整形),求每行元素总和,并将每行总和排序输出
#include "stdio.h"#define H 5#define L 10int total(int *p,int n)//___________________________一维数组求和{ int all = 0; for(int i =0;i<n;i++) { all = all + p[i]; } return all;}void sort(int *原创 2013-11-28 18:15:56 · 2223 阅读 · 0 评论 -
输入5个字符串,排序后输出!
#include "stdio.h"#include #include #define MAX 10void main(){ int i,j; char str[5][MAX] = {0}; //char s[5]; printf("请输入5个字符串!\n"); for(i = 0;i<5;i++) { scanf("%s",str[i]); } printf("原创 2013-11-28 15:10:07 · 5025 阅读 · 0 评论 -
输入年月日时分秒,输出下一秒的时间。
#include "stdio.h"void main(){int yea,mon,day,hou,min,sec;while(1){printf("请输入年月日时分秒!\n");scanf("%d%d%d%d%d%d",&yea,&mon,&day,&hou,&min,&sec);printf("你输入的是时间是:\n%d年%d月%d日%d小时%d分%d秒\n",原创 2013-11-27 13:18:38 · 3412 阅读 · 0 评论 -
字符串反转
#include "stdio.h"#include void main(){char str[20];printf("请输入想要反转的字符串!\n");scanf("%s",str);int n =strlen(str);for(int i = 0;i {printf("%c",str[n-i-1]);}}//DD原创 2013-11-27 13:37:45 · 856 阅读 · 0 评论 -
日历,未完成
#include "stdio.h"#include int Leap(int x){if((x%400 == 0)||((x%4 == 0) && (x%100 != 0)) )//闰年return 366;elsereturn 365;}int monfun(int year,int mon){if(Leap(year) == 366)//闰年{原创 2013-12-04 20:54:38 · 1114 阅读 · 0 评论