自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

摆渡人的博客

day day up~~~~

  • 博客(50)
  • 收藏
  • 关注

原创 hdoj 1230 火星A+B(模拟加法进位运算)

思路:题意还是比较好理解的,第几位就是逢第几个素数进一;如个位逢2进1,十位逢3进1,百位逢5进1,....然后模拟这样的进位操作输出结果就好了;代码如下:#include #include #include #include #include #include #include using namespace std;int ss[30];void fun()

2017-12-29 16:00:26 260

原创 hdoj 1229 还是A+B(简单水题,但是因为思维不够活跃,一开始做的很麻烦)

思路:直接取余数,得到后面几位,然后比较就可以了,方法简单不会错;代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int a, b; int k; int len1,len2; int flag; int

2017-12-28 12:52:32 348

原创 hdoj 1228 A+B (模拟题)

思路:直接给代码了;代码如下:#include #include #include #include #include #include #include using namespace std;char key[10][10] = { "zero","one","two","three","four","five","six","seven","eight","ni

2017-12-28 11:57:31 201

原创 hdoj 1225 football sorce(尝试了50次的水题)

思路:简单题,细节很多;直接给代码;#include #include #include #include #include #include #include using namespace std;struct node{ char name[1010]; int win; int lose; int point;}team[1010];int judg

2017-12-27 20:22:41 169

原创 hdoj 1219 AC Me (超时请进)

思路:TLE见代码;代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ char a[100010]; int sum[26]; int i; char x; int l; while(gets(a)) {

2017-12-20 16:22:00 194

原创 HDOJ 1218 Blurred Vision (水题)

思路:注意输入是不带空格的;代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ char a[10][10]; //因为输入间没有空格,所以先当成字符进行操作 char s[20]; int i,

2017-12-20 15:58:45 148

原创 hdoj 1202 the calculation of GPA(水题)

思路:直接给代码了代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int n; double s,p; double sum1,sum2; while(scanf("%d",&n)!=EOF) { su

2017-12-20 14:59:39 212

原创 HDOJ 1201 18岁生日

思路:注意:如果是2月29出生的,那么没18岁生日,如果是2月后出生的则计算从下一年开始是不是闰年;代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int t; int year; int y; int r;

2017-12-20 14:43:36 99

原创 HDOJ 1200 To and Fro(模拟题)

思路:直接给代码了;代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ char a[30][200]; char b[510]; int c; int i,j,i1; int x; int len;

2017-12-20 14:18:55 184

原创 hdoj 1197 specialized four-digit numbers(水)

思路:直接给代码了代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int i; int sum1,sum2,sum3; int temp; for(i=2992;i<10000;i++) {

2017-12-20 13:11:26 173

原创 hdoj 1196 Lowest Bit(水题)

思路:直接给代码代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int n; int a[20]; int i; int x; while(scanf("%d",&n)&& n

2017-12-20 12:52:56 167

原创 hdoj 1194 Beat the Spread!(数学题)

思路:当s代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int x1,x2; int y1,y2; int s,d; int n; scanf("%d",&n); w

2017-12-20 12:32:51 176

原创 hdoj 1178 Heritage from father (数学题)

思路:1+6+.....+i(i+1)/2=i*(i+1)*(i+2);代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int n; int i; double sum; int a; while(

2017-12-20 11:46:40 505

原创 hdoj 1170 ballon Comes!(水)

思路:注意下四舍五入就好代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int t; int a,b; char c; double r; scanf("%d%*c",&t); while(t--) {

2017-12-19 19:49:49 210

原创 HDOJ 1163 Eddy's digital Root (简单数论,但我也不会。。。。)

思路:反正我推不出这公式。。。。root(ab*cd) = a*c+a*d+b*c+b*d = (a+b)*(c+d);代码如下:#include #include #include #include #include #include #include using namespace std;int boot(int n){ int m,sum,a;

2017-12-19 19:34:10 232

原创 hdoj 1157 Who's in the Middle(心机水题)

思路:看到的人估计都是只做了一组数据吧。。。。。这题要多组数据的。。。题目里还没讲。。。很尴尬代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int n; long a[100010]; int i;

2017-12-19 18:34:12 149

原创 HDOJ 1152 Brownie Points I(水题)

思路:水题不多说,直接给代码;代码如下:#include #include #include #include #include #include #include using namespace std;struct node{ int x; int y; };node p[200010];int main(){ int n; int i; in

2017-12-19 17:57:51 156

原创 hdoj 1148 Rock-Paper-Scissors Tournament(模拟题)

思路:注意是两个测试输出之间有空行,而不是每测试后加一个空行,还有当w=l=0时会输出“-”;代码如下:#include #include #include #include #include #include #include using namespace std;struct{ int win; int lost;}p[110];int main()

2017-12-19 16:36:44 157

原创 hdoj prerequisites? (水题)

思路:按照题意翻译成代码就行;代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int k; int m; int num1[110]; int temp; int c; int r; int i; i

2017-12-19 15:29:34 142

原创 hdoj 1141 Factstone Benchmark(数学题。。)

思路:题目意思是求n!代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ int a[30]; int i; int y=1960; int n; long bit; double sum; for(

2017-12-19 13:51:54 202

原创 hdoj 1129 Do the Untwist(数学公式+英文理解)

思路:模拟题,但是那个公式怎么倒推我不会。。。。上网查了题解。。。代码如下:#include #include #include #include #include #include #include using namespace std;int c[80];int change(int k,int i,int n){ if(c[(k*i%n)]-i>=0)

2017-12-18 16:45:16 285

原创 hdoj 1128 self-numbers

思路:自私数是没有数+每个位上的数可以得到的,所以建立一个数组,把可以变化得到的数记录下来,输出的时候不输出这些数就好;代码如下:#include #include #include #include #include #include #include using namespace std;int a[1000010];void judge(int n)

2017-12-18 13:05:07 203

原创 hdoj 1124 Factorial (第一次接触数论)

思路:所有的0都是由5*2提供的,所以只要求出阶乘中5(及其倍数)的个数就行;代码如下:#include #include #include #include #include #include #include using namespace std;int main(){ long long n,i,sum,x; int t; scanf("

2017-12-18 12:09:54 170

原创 hdoj 1113 Word Amalgamation (字符串处理)

思路:把字典中的单词的字母进行排序,把输入的单词的字母也进行排序,然后比较相等则输出;注意:在有多个输出时关注输出的每个单词是按字母的ASCII码进行排序才输出;代码如下:#include #include #include #include #include using namespace std; /* run this program using the console p

2017-12-15 17:05:58 222

原创 hdoj 1084 What Is Your Grade?(sort函数按规则排序结构体数组)

思路:对输入的学生的解决问题数和用时进行排序;先排解觉问题的数目,再排用时;代码如下:#include #include #include #include using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or inpu

2017-12-15 15:13:38 236

原创 hdoj 1073 online judge (刻骨铭心的水题)

思路:将两次输入的字符串进行比较如果一样直接输出ac(这步很重要我就被wa了茫茫多次)如果不输出,在下面进行判断则会产生错误;当两个字符串清除了'\n''\t'' '之后相等,并且之前的长度相等时,这两个字符串是不一定相等的,比如一个是\t一个是\n;应该输出pe而非ac代码如下:#include #include #include /* run this program usi

2017-12-14 10:35:44 305

原创 Hdoj 1064 Financial Management(水题)

思路:注意四舍五入就好;代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { double i;

2017-12-13 14:03:07 266

原创 Hdoj 1062 text reverse(水题)

思路:感觉就是模拟题。。。。。直接给代码代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { char

2017-12-13 13:38:50 357

原创 hdoj 1052 Tian Ji -- The Horse Racing(第一次接触贪心)

思路:先将两个人的马进行排序;先拿田和王最慢的马进行比较1.如果田>王,直接田赢下一局。2.如果小于,用田的最慢马,输给王。3.如果等于,比较田和王的最快马3.1如田的最快马>#include #include #include /* run this program using the console pauser or add your own getch, sy

2017-12-12 20:04:35 270

原创 hdoj 1049 climbing worm(小学数学题)

思路:不多说了。。。。代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */#define p 3.1415927int main(int argc, char *a

2017-12-12 16:08:12 174

原创 hdoj 1048 the hardest problem ever (水题)

思路:翻译规则,照例输入代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */#define p 3.1415927char end[]="ENDOFINPUT";ch

2017-12-12 15:45:47 165

原创 hdoj 1046 Gridland(找规律)

思路:不用广搜来做;找到规律就行,当n,m都为奇数时长度为n*m-1+sqrt(2);否则就是n*m;代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */#define

2017-12-12 14:39:26 187

原创 hdoj 1039 Easier Done Than Said?(水题)

思路:规则翻译就好代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */#define p 3.1415927int judge(char c){ if(c=='a'

2017-12-12 14:09:02 196

原创 hdoj 1037 Biker's trip odometer (巨水)

思路:翻译数学公式。。。。。代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */#define p 3.1415927int main(int argc, char *

2017-12-11 15:56:34 167

原创 hdoj 1037 Keep on Truckin'(巨水无比)

思路:第一次在hdoj上遇到这么水的。。。。正常输入输出就好代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]

2017-12-11 15:25:19 228

原创 Hdoj 1036 Average is not fast enough!(被一个冒号,wa7次的恐惧)

思路:注意输出格式,和题目(n代表的是每组数据的个数),用字符串进行输入;代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, cha

2017-12-11 15:05:13 200

原创 HDoj 1033 Edge (英语理解题)

思路:文章很长,我的英语水平不行。。。题目不难,水题;代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */char dir;int main(int argc, char

2017-12-08 14:07:33 208

原创 Hdoj 1032 The 3n+1 problem (看题目很重要)

思路:找出i ,j之间所有数的循环数(包括i,j),把最大值输出(注意!i不一定大于j)(没看到这个被wa了。。。)代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */in

2017-12-06 20:01:35 230

原创 HDoj 1031 Design T-shirt(题目很绕的水题)

思路:题目理解了很久。。。。(调用了两个快排,只是为了熟悉下快排怎么用)代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */void swp(int *a,int *b)

2017-12-06 19:01:35 228

原创 hdoj 1022 Train Problem I (第一次接触栈)

思路:定义一个栈,将火车一个个放入栈中,直到出现一个火车(该火车要先出去),等所有火车都进入完栈,并且都出完栈,返回yes+方法,否则返回no;代码如下:#include #include #include /* run this program using the console pauser or add your own getch, system("pause") or inpu

2017-12-06 16:55:09 118

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除