会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
程序monkey
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
7
8
下一页
2015年4月30日
给你n个数,其中有且仅有一个数出现了奇数次,其余的数都出现了偶数次。用线性时间常数空间找出出现了奇数次的那一个数。
摘要: //有101个数,其中有50个数出现了两次,有一个数只出现了一次,找出出现一次的数#include #include int main(){ int a[11] = {0}; int i; int n = 0; printf("please input the arr :")...
阅读全文
posted @ 2015-04-30 08:11 码农@163
阅读(1291)
评论(0)
推荐(0)
2015年4月27日
请问在C++中clrscr,textbackground,textmode,textcolor这些函数有什么用?如何用?它们被包含在哪个头文件中?
摘要: 全包含在:conio.h中clrscr:控制台程序清屏!光标回到1,1点voidclrscr(void);textbackground:选择一种新的文本背景色voidtextbackground(intnewcolor);textmode:将屏幕设置为文本模式voidtextmode(intnewm...
阅读全文
posted @ 2015-04-27 20:24 码农@163
阅读(1219)
评论(0)
推荐(0)
2015年4月18日
文件操作函数1
摘要: 文件的操作标准流stdin 标准输入流 stdout 标准输出流 stderr 标准错误流FILE 文件位置指示符 错误指示符 文件结束指示符1,提高速度 使用文件指针2 文件指针与磁盘文件建立联系,以后对文件操作都将通过文件指针来进行。 fopen(文件名,使用文件方式) 文件打开不成...
阅读全文
posted @ 2015-04-18 16:23 码农@163
阅读(261)
评论(0)
推荐(0)
复制文件。输入完整已存在的文本文件名,再输入一个新文本文件的完整文件名,利用文本编辑软件查看文件内容,验证程序执行结果
摘要: 1 #include "stdafx.h" 2 #include 3 #include 4 #define N 80 5 int CopyFile(const char *srcName,const char *dstName); 6 int main() 7 { 8 char src...
阅读全文
posted @ 2015-04-18 11:21 码农@163
阅读(731)
评论(0)
推荐(0)
在指定文件中查找指定编号的学生
摘要: 1 #include "stdafx.h" 2 #include 3 #include 4 #define N 30 5 typedef struct date 6 { 7 int year; 8 int month; 9 int day;10 }DATE;11 typ...
阅读全文
posted @ 2015-04-18 10:52 码农@163
阅读(294)
评论(0)
推荐(0)
利用结构体计算每个学生的4门课程的平均分,将各科成绩及平均分输出到score.txt中
摘要: #include "stdafx.h"#include #include typedef struct date{ int year; int month; int day;}DATE;typedef struct student{ long studentID; ch...
阅读全文
posted @ 2015-04-18 09:31 码农@163
阅读(1432)
评论(0)
推荐(0)
2015年4月17日
通过键盘向结构体输入数据然后存到文件中,然后从文件中读出来,在显示器上进行显示
摘要: #include "stdafx.h"#include #include struct student{ char name[10]; int num; int age; char addr[40];};student s1[2],s2[2],*p1,*p2;int main...
阅读全文
posted @ 2015-04-17 16:37 码农@163
阅读(674)
评论(0)
推荐(0)
fputc的使用
摘要: #include "stdafx.h"#include #includeint main(){ FILE *fp; char ch; char *str = "www.cskaoyan.com"; if(fopen_s(&fp,"ReadMe.txt","at+") != N...
阅读全文
posted @ 2015-04-17 15:39 码农@163
阅读(215)
评论(0)
推荐(0)
文件操作的一些函数
摘要: 文件的操作1,提高速度 使用文件指针2 文件指针与磁盘文件建立联系,以后对文件操作都将通过文件指针来进行。 fopen(文件名,使用文件方式) 文件打开不成功 将返回一个空指针NULL 文件使用方式 r w rb wb fgetc() getc() 从指定文件中一次读取一个字符 ...
阅读全文
posted @ 2015-04-17 14:52 码农@163
阅读(157)
评论(0)
推荐(0)
文件的复制贴贴
摘要: #include "stdafx.h"#include #include int main(){ FILE *readfile,*writefile; char ch; fopen_s(&readfile,"ReadMe.txt","r"); fopen_s(&writef...
阅读全文
posted @ 2015-04-17 14:36 码农@163
阅读(332)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
下一页
公告