03 2012 档案

摘要:写文件import osls=os.linesep#get filenamefname=raw_input('Enter file name: ')if os.path.exists(fname): print "Error:"+fname #get file contentall=[]print "\nEnter lines ('.' by itself to quit).\n"while True: entry=raw_input('> ') if entry=='.': brea 阅读全文
posted @ 2012-03-31 11:05 代码示例 阅读(1503) 评论(2) 推荐(1) 编辑
摘要://去除重复的字符,返回不重复的char* mystrcpy(char* dest, const char* src){ char* tmp = dest; while ((*tmp++= *src) != '\0') { src=src+2; } return dest;}int main(){ char a[50], c[]="aaddmmiigghhjj"; mystrcpy(a,c); printf("%s\n",a); return 0;} 阅读全文
posted @ 2012-03-01 13:16 代码示例 阅读(291) 评论(2) 推荐(0) 编辑

点击右上角即可分享
微信分享提示