2、自己实现strcpy函数//自己实现复制函数int strcpy_arr(char str1[], char str2[]) { for(int i=0;arr1[i]!='\0';i++) { arr[i]=arr1[i]; } arr[i]='\0'; }//3、自己实现strlen函数int strlen_arr(char str[])//3、自己实现strlen函数{ // int count=0;// while(*str!='\0') {// count++;// str++;// }// return count... Read More
posted @ 2013-10-23 21:54 lanacon Views(111) Comments(0) Diggs(0) Edit
今天学习了结构体。诶呀,结构体丫丫的。struct stu{int age;char name[20];float score;};今天的作业呵呵,对我来说还可以吧。不是那么难。//1、定义一个结构体变量(包含年月日),计算该日在本年中为第几天?要求写一个days函数。参数是此结构体类型的变量,返回值是整数。//2、模拟n个人参加选举的过程,四个候选人A、B、C、D。若选举某人直接输入其编号,最后按获得票数从高到低排序并输出候选人编号和票数。//3、某班5个学生,3门课,编写3个函数实现以下功能://(1)求各门课的平均分//(2)找出三门都不及格的学生,输出其全部信息//(3)找出3门课平均 Read More
posted @ 2013-10-23 21:46 lanacon Views(255) Comments(0) Diggs(0) Edit
1、找出一个二维数组中的“鞍点”,即该位置上的元素在该行中最大,在该列中最小(也可能没鞍点),打印出有关信息。//// main.c// andian//// Created by lanou on 13-10-22.// Copyright (c) 2013年 星星科技. All rights reserved.//#include #include #define N 3#define M 3 /* int i,j,k,max,maxj,flag; int a[N][M]={ {1,9,6} ,{2,7,5} ,{8,9,... Read More
posted @ 2013-10-23 21:30 lanacon Views(176) Comments(0) Diggs(0) Edit