描述: 编写一个程序实现将字符串中的所有"you"替换成"we" #include<stdio.h>#include<string.h>int main(){ char s[1005]; int a,b,n,i; while(gets(s)!=NULL)//gets能接收含空格的字符串 { a=st ...
分类:
其他好文 时间:
2017-07-24 10:02:33
阅读次数:
133
一、问题引入 原题:杭电hdu1232畅通工程 题意:首先在地图上给你若干个城镇,这些城镇都可以看作点,然后告诉你哪些对城镇之间是有道路直接相连的。最后要解决的是整幅图的连通性问题。比如随意给你两个点,让你判断它们是否连通,或者问你整幅图一共有几个连通分支,也就是被分成了几个互相独立的块。像畅通工程 ...
分类:
其他好文 时间:
2017-07-24 00:07:00
阅读次数:
162
1 #include 2 #include 3 #include 4 #define N 110 5 #define M 5000 6 using namespace std; 7 8 int n, m, u[M], v[M], w[M], r[M], p[N]; 9 bool cmp(int i,... ...
分类:
其他好文 时间:
2017-07-23 21:00:58
阅读次数:
120
题目描述: 求A+B是否与C相等。 #include<stdio.h>int main(){ int N; scanf("%d",&N); while(N--) { double a,b,c; scanf("%lf %lf %lf",&a,&b,&c); if(a+b-c>=-0.0001&&a+b ...
分类:
其他好文 时间:
2017-07-23 21:00:03
阅读次数:
120
1 //克鲁斯卡尔 2 #include 3 #include 4 using namespace std; 5 const int maxn = 10005; 6 struct node 7 { 8 int begin, end, len; 9 }cun[maxn]; 10 int n, fa[m... ...
分类:
其他好文 时间:
2017-07-23 19:56:39
阅读次数:
170
时间限制:1000 ms | 内存限制:65535 KB 难度:4 描写叙述南阳理工学院要进行用电线路改造。如今校长要求设计师设计出一种布线方式,该布线方式须要满足下面条件: 1、把全部的楼都供上电。 2、所用电线花费最少 输入第一行是一个整数n表示有n组測试数据。(n<5) 每组測试数据的第一行是 ...
分类:
编程语言 时间:
2017-07-23 19:48:34
阅读次数:
133
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 1005 8 int n, m; 9 int fa[MAXN]; //父节点 10 int mark[MAXN]; 11 12 vo... ...
分类:
其他好文 时间:
2017-07-23 19:47:29
阅读次数:
185
题目描述: 已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。 #include<stdio.h>#include<math.h>int main(){ int M; scanf("%d",&M); while(M--) { long in ...
分类:
其他好文 时间:
2017-07-23 19:37:20
阅读次数:
151
题目描述: 输入一个日期,格式如:2010 10 24 ,判断这一天是这一年中的第几天。 #include<stdio.h>int main(){int a,b=0,c,y,m,d,fib;scanf("%d",&a);while(a--){scanf("%d %d %d",&y,&m,&d);if ...
分类:
其他好文 时间:
2017-07-23 18:28:54
阅读次数:
181
题目描述: Tom has many cigarettes. We hypothesized that he has n cigarettes and smokes them one by one keeping all the butts. Out of k > 1 butts he can ro ...
分类:
其他好文 时间:
2017-07-23 18:13:10
阅读次数:
139