摘要: 标准c语言#include //---------回车被第一个 gets(s) 接收char s[100]; // -----直接换行,,,,,少一行int main(int argc, char ... 阅读全文
posted @ 2014-08-01 23:58 2014acm 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 错误#include#include#includeusing namespace std;struct node { int a; char s[1000]; }p[1000];int cmp(node c,node b){ return c.ap[k].s[j]) p[k].a++; ... 阅读全文
posted @ 2014-08-01 23:20 2014acm 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;struct node{ int a; char s[105]; }p[105];int cmp(node c,node b){ return c.a #include #inclu... 阅读全文
posted @ 2014-08-01 23:14 2014acm 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(int argc, char *argv[]){ double a,b; cin>>a; while (cin>>b) { if (b==999) { ... 阅读全文
posted @ 2014-08-01 22:57 2014acm 阅读(111) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#include#includeusing namespace std;int main(){ int t,i,n,k; string s,ss,s1,s2; while(cin>>t) { ... 阅读全文
posted @ 2014-08-01 22:47 2014acm 阅读(126) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){ int a[51],n,k=1; while(cin>>n,n) { int i,ans=0,s=0; for(i=0;i>a[i]; s+=a[i]... 阅读全文
posted @ 2014-08-01 22:41 2014acm 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(){ string n; while(cin>>n,n!="0"){ int s=0,l=n.length(); for(int i=0;i9) s=s/10+s%10; cout... 阅读全文
posted @ 2014-08-01 22:35 2014acm 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(int argc, char *argv[]){ int i,n,m; string s; while(cin>>m) { while(m--) { cin>>s; n=1; if(s.si... 阅读全文
posted @ 2014-08-01 21:01 2014acm 阅读(94) 评论(0) 推荐(0) 编辑
摘要: -#include using namespace std;int main(int argc, char *argv[]){ int n,i,sum; string s; cin>>n; while(n--) { cin>>s; for(i=0,sum=1;s[i];i++) { if(... 阅读全文
posted @ 2014-08-01 20:56 2014acm 阅读(119) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int a[1000];int f(int n){ int k=0; while(n) { a[k++]=n%2; n/=2; } return k;}int main(int argc, char *argv[]){ int n,m,... 阅读全文
posted @ 2014-08-01 20:50 2014acm 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Sample input:24 1 2 3 4 5 1 2 3 4 5 Sample output: 10 15 // C语言AC代码#include int n,c,t,sum; int main() { while( s... 阅读全文
posted @ 2014-08-01 20:04 2014acm 阅读(304) 评论(0) 推荐(0) 编辑
摘要: ctrl +z 的使用#includeusing namespace std; main(){ int num,sum=0; while(cin>>num) { sum+=num; } cout u... 阅读全文
posted @ 2014-08-01 19:33 2014acm 阅读(117) 评论(0) 推荐(0) 编辑
摘要: QuicksumTime Limit: 2 Seconds Memory Limit: 65536 KBA checksum is an algorithm that scans a packet of data and returns a single number. The idea is... 阅读全文
posted @ 2014-08-01 19:17 2014acm 阅读(219) 评论(0) 推荐(0) 编辑
摘要: C语言实验四(函数):题目1、数字根时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:305 测试通过:185描述正整数的数字根是将数位上的数字求和进行计算而来。如果各位数字之和为一位的整数,那么这个整数就是这个数的数字根;如果之后为... 阅读全文
posted @ 2014-08-01 17:54 2014acm 阅读(361) 评论(0) 推荐(1) 编辑
摘要: Reverse TextTime Limit: 2 Seconds Memory Limit: 65536 KBIn most languages, text is written from left to right. However, there are other languages whe... 阅读全文
posted @ 2014-08-01 17:40 2014acm 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Geometry Made SimpleTime Limit: 2 Seconds Memory Limit: 65536 KBMathematics can be so easy when you have a computer. Consider the following example. ... 阅读全文
posted @ 2014-08-01 17:36 2014acm 阅读(182) 评论(0) 推荐(0) 编辑
摘要: DNA SortingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1924Accepted Submission(s): 949Problem ... 阅读全文
posted @ 2014-08-01 17:31 2014acm 阅读(282) 评论(0) 推荐(0) 编辑
摘要: Reverse NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5052Accepted Submission(s): 2352Prob... 阅读全文
posted @ 2014-08-01 17:28 2014acm 阅读(148) 评论(0) 推荐(0) 编辑
摘要: FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 42882Accepted Submission(s): 14310P... 阅读全文
posted @ 2014-08-01 17:25 2014acm 阅读(107) 评论(0) 推荐(0) 编辑
摘要: C++ sort函数的用法STL有个排序函数sort,可以直接对数组和向量排序。一、功能:给定区间所有元素进行排序二、头文件: #include 三、sort函数的参数:可以传两个参数或三个参数。第一个参数:要排序的区间首地址,第二个参数:区间尾地址的下一地址。也就是说,排序的区间是[a,b)。例如... 阅读全文
posted @ 2014-08-01 12:54 2014acm 阅读(892) 评论(0) 推荐(0) 编辑