2014年3月7日

c语言的详细编译过程

摘要: gcc编译c语言的整个编译过程可分为预编译->编译->汇编->链接我们先编辑一个name.c文件1 # include2 int main(int argc, const char *argv[])3 {4 printf("Hello World\n");5 return 0;6 }预编译:处理#号开头的所有程序行gcc -E name.c -o name.iname.i文件如下 1 # 1 "name.c" 2 # 1 "" 3 # 1 "" 4 # 1 "name.c" 5 阅读全文

posted @ 2014-03-07 14:33 asif 阅读(712) 评论(0) 推荐(0) 编辑

2014年3月2日

stream和dgram的区别

摘要: SOCK_STREAM是基于TCP的,TCP协议是一种可靠的数据传输协议,所以SOCK_STREAM数据传输比较有保障的面向连接的SOCKET。SOCK_DGRAM是基于UDP的,而UDP协议是一种尽最大努力交付的传输协议,传送过程中游客能导致部分数据的流失,所以SOCK_DGRAM是一种无保障面向连接的SOCKET。SOCK_STREAM 是数据流,一般是tcp/ip协议的编程,SOCK_DGRAM分是数据抱,是udp协议网络编程。 阅读全文

posted @ 2014-03-02 13:17 asif 阅读(4863) 评论(0) 推荐(0) 编辑

2014年2月26日

约瑟夫环求最后剩余的元素

摘要: 递推公式f[1]=0;f[i]=(f[i-1]+m)%i; (i>1)# include# include# include# include# include# includeusing namespace std;# define maxn 1000001int main(){ int n,m; while(cin>>n>>m) { int ans=0; for(int i=2;i<=n;i++) ans=(ans+m)%i; printf("%d\n",ans+1); } return 0;}View ... 阅读全文

posted @ 2014-02-26 10:29 asif 阅读(247) 评论(0) 推荐(0) 编辑

2014年2月22日

centos /usr/bin/ld: cannot find -lc 的问题

摘要: 最近用c语言编程,用到了--static这个参数,结果出现了以下的错误提示:/usr/bin/ld: cannot find -lccollect2: ld 返回 1而出现这种情况的主要原因是系统里面缺少静态库,所以静态链接是会找不到,解决的方法就是安装对应的库文件就可以了。如下:#yum install -y glibc-static libstdc++-static 阅读全文

posted @ 2014-02-22 21:18 asif 阅读(2471) 评论(0) 推荐(0) 编辑

2014年2月21日

隧道适配器 本地连接* 61: 媒体状态 . . . . . . . . . . . . : 媒体已断开 连接特定的 DNS 后缀 . . . . . . . : 隧道适配器 本地连接* 62: 媒体状态 . . . . . . . . . . . . : 媒体已断开

摘要: 隧道适配器 本地连接* 61: 媒体状态 . . . . . . . . . . . . : 媒体已断开 连接特定的 DNS 后缀 . . . . . . . :隧道适配器 本地连接* 62: 媒体状态 . . . . . . . . . . . . : 媒体已断开 连接特定的 DNS 后缀 . . . . . . . :隧道适配器 isatap.my.domain: 媒体状态 . . . . . . . . . . . . : 媒体已断开 连接特定的 DNS 后缀 . . . . . . . : my.domain当无线网络建立的太多而又没有关闭的时候在cmd里面输入... 阅读全文

posted @ 2014-02-21 02:31 asif 阅读(8047) 评论(0) 推荐(0) 编辑

2014年1月29日

nbuoj 1537 Travel

摘要: [1537] Travel时间限制: 2000 ms 内存限制: 65535 K问题描述One time, group master organized nekoTeam to travel, he always send a person to toilet before arriving a scene, and the rest of the people continued to move forward.The scenes are numbered from 1 to n, nekoTeam was going from scene 1 to scene n.输入The first 阅读全文

posted @ 2014-01-29 21:11 asif 阅读(840) 评论(0) 推荐(0) 编辑

nbuoj 1532 New String

摘要: [1532] New String时间限制: 2000 ms 内存限制: 65535 K问题描述Ceil so love the new string.If you can erase any character from the string, and use the remain character by any order to comprise the "new" , the string is the new string, otherwise not.Give you some string, you should help Ceil determine whe 阅读全文

posted @ 2014-01-29 18:31 asif 阅读(957) 评论(0) 推荐(0) 编辑

导航