向前走莫回头❤

随笔分类 -  北大先修课-计算概论

摘要:1:大象喝水#include#includeusing namespace std;const double pi=3.14159;int main(){ int h,r; scanf("%d%d",&h,&r); double v=(double)h*r*r*pi;... 阅读全文
posted @ 2016-10-21 22:49 lris0-0 阅读(154) 评论(0) 推荐(0)
摘要:1:求平均年龄#includeusing namespace std;int main(){ int n; scanf("%d",&n); int ans=0; for(int i=1;iusing namespace std;double d[10]={28.9,3... 阅读全文
posted @ 2016-10-20 22:00 lris0-0 阅读(149) 评论(0) 推荐(0)
摘要:1:短信计费#include#include#includeusing namespace std;int n;int main(){ int i; int t=0; scanf("%d",&n); for(i=1;i0) t++; } printf("%.1lf\... 阅读全文
posted @ 2016-10-20 21:55 lris0-0 阅读(127) 评论(0) 推荐(0)
摘要:01:鸡尾酒疗法#include#include#includeusing namespace std;const double eps=0.05;int n,x,y;int main(){ scanf("%d%d%d",&n,&x,&y); double p=(do... 阅读全文
posted @ 2016-10-20 21:52 lris0-0 阅读(104) 评论(0) 推荐(0)
摘要:1:找和为K的两个元素#include#include#includeusing namespace std;int a[1010],n,k;int main(){ int i,j; scanf("%d%d",&n,&k); for(i=1;i#include#inc... 阅读全文
posted @ 2016-10-20 21:45 lris0-0 阅读(112) 评论(0) 推荐(0)
摘要:1:数组逆序重放#include#include#includeusing namespace std;int a[110],n;int main(){ int i; scanf("%d",&n); for(i=1;i0;--i) printf("%d ",a[i])... 阅读全文
posted @ 2016-10-20 21:39 lris0-0 阅读(93) 评论(0) 推荐(0)
摘要:1:统计字符数#include#includeusing namespace std;char ch[1010];int num[150],n,len;int main(){ int i; scanf("%d",&n); while(n--) { getchar... 阅读全文
posted @ 2016-10-20 21:32 lris0-0 阅读(96) 评论(0) 推荐(0)
摘要:1:单词替换#include#include#includeusing namespace std;char s[110],s1[110],s2[110];int len,l1,l2;int main(){ //freopen("int.txt","w",stdout... 阅读全文
posted @ 2016-10-20 10:44 lris0-0 阅读(101) 评论(0) 推荐(0)
摘要:1:单词翻转#include#include#include#includeusing namespace std;char s[510];int len;int main(){ int i,last=0; gets(s); len=strlen(s); fo... 阅读全文
posted @ 2016-10-20 10:41 lris0-0 阅读(117) 评论(0) 推荐(0)
摘要:1:数组逆序重放#include#include#includeusing namespace std;int a[110],n;int main(){ int i; scanf("%d",&n); for(i=1;i0;--i) printf("%d ",a[i])... 阅读全文
posted @ 2016-10-20 10:37 lris0-0 阅读(148) 评论(0) 推荐(0)
摘要:1:括号匹配问题#include#include#includeusing namespace std;char s[110];int len,d[110],t;bool p[110];int main(){ while((scanf("%s",s+1))==1) ... 阅读全文
posted @ 2016-10-20 10:32 lris0-0 阅读(164) 评论(0) 推荐(0)
摘要:1:全排列#include#include#includeusing namespace std;char ch[10];int len,a[10];bool p[10];void dfs(int t){ if(t>len) { for(int i=1;i#in... 阅读全文
posted @ 2016-10-20 10:28 lris0-0 阅读(88) 评论(0) 推荐(0)
摘要:#include#include#include#includeusing namespace std;string s1,s2;int main(){ int i,len; cin>>s1; len=s1.length(); for (i=1... 阅读全文
posted @ 2016-10-20 10:25 lris0-0 阅读(91) 评论(0) 推荐(0)
摘要:#includeusing namespace std;int a[110],n;int main(){ int i; scanf("%d",&n); for (i=1;i0;i--) printf("%d ",a[i]); return 0;}#include#i... 阅读全文
posted @ 2016-10-16 11:41 lris0-0 阅读(164) 评论(0) 推荐(0)
摘要:#include#include#include#include#includeusing namespace std;struct ch{ string name; int yue,day,len;}child[200];int tmp(ch a,ch ... 阅读全文
posted @ 2016-10-13 21:58 lris0-0 阅读(150) 评论(0) 推荐(0)
摘要:34:回文子串 查看 提交 统计 提问 总时间限制: 1000ms 内存限制: 65536kB 描述 给定一个字符串,输出所有长度至少为2的回文子串。回文子串即从左往右输出和从右往左输出结果是一样的字符串,比如:abba,cccdeedccc都是回文字符串。输入 一个... 阅读全文
posted @ 2016-04-14 23:19 lris0-0 阅读(268) 评论(0) 推荐(0)

过去的终会化为美满的财富~o( =∩ω∩= )m