自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 HDU---2037

HDU—2037 解法: #include<stdio.h> #include<stdlib.h> #define MAXN 100 struct node { int start; int end; }record[MAXN]; int cmp(const void*a,const void*b) { struct node*x=(struct node *)a; struct node*y=(struct node *)b; return x->end-y-&g

2021-04-17 22:03:00 84

原创 HDU---1050

hdu—1050 解法: #include<iostream> #include<cstring> using namespace std; int main(){ int t,k; cin>>t; for(k=1;k<=t;k++) { int n,i,j,count[403]; memset(count,0,sizeof(count));//初始化 cin>>n; int a,b,temp; for(j=1;j<=n

2021-04-16 16:59:02 96

原创 HDU---1052

hdu–1052 解法: #include<stdio.h> #include<algorithm> using namespace std; int main() { int n,i,j,c,k,d,l,a[1002],b[1002]; while(scanf("%d",&n)!=EOF&&n!=0) { for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<n;i++) scanf("

2021-04-15 23:17:44 72

原创 hdu--1009

[hdu–1009](http://acm.hdu.edu.cn/showproblem.php?pid=100 #include<bits/stdc++.h> using namespace std; #define maxn 1005 struct Hourse{ int j,f; }; int m,n; double jb; Hourse hourse[maxn]; bool cmp(Hourse a,Hourse b) { if((a.j/(double)a.f)&

2021-04-14 22:18:01 58

原创 HDU--2899

添加链接描述 HUD–2899 解法: #include <stdio.h> #include <math.h> #define eps 1e-8 double y; double cal(double x) { return 6 * pow(x,7)+8*pow(x,6)+7*pow(x,3)+5*pow(x,2)-y*x; } int main() { int t; scanf("%d",&t); whi

2021-04-08 20:14:50 92

原创 HDU---2035

杭电2035 解法: #include<stdio.h> int main() { int a,b,i,mul; while(scanf("%d %d",&a,&b)!=EOF) { if(a==0&&b==0)break; mul=1; for(i=0;i<b;i++) { mul=mul*a%1000; } printf("%d\n",mul); } return 0; }

2021-04-05 20:52:08 67

原创 HDU---1021

添加链接描述 一,题目的意思,就是F(0)=7,F(1)=11, F(n)=F(n-1)+F(n-2), (n>=2) 求F(n)能否被3整除,如果能被3整除的话,则直接输出yes,不能被3整除的话,直接输出no 二,解题思路,不能使用递归,否则超时 可以发现规律,就是F(n)以4为一个周期,依次循环。所以不要用递归来做这题。有时候可以看看其他巧妙的解题思路。 F(0)=7 NO F(1)=11 NO F(2)=18 YES F(3)=29 NO F(4)=47 NO F(5)=73 NO F(6)

2021-04-01 11:44:56 81

原创 HDU---1019

(http://acm.hdu.edu.cn/showproblem.php?pid=1019) #include<stdio.h> int gcd(int a,int b) { return b?gcd(b,a%b):a; } int main() { int T,n,x,temp; scanf("%d",&T); while(T--) { scanf("%d %d",&n,&temp);

2021-03-31 18:04:30 50

原创 HDU --1108最小公倍数

法一: #include <stdio.h> int main (void) { int a,b,i; while(scanf("%d%d",&a,&b)!=EOF) { for(i=a;;i+=a) if(i%b==0) { printf("%d\n",i); break; } } return 0; } 法二: #incl.

2021-03-30 22:03:44 62

原创 HDU---1001计算总和

#include<stdio.h> int main() { int n,i; int sum=0; while(scanf("%d",&n)!=EOF) { for(i=1;i<=n;i++) sum=sum+i; printf("%d\n\n",sum); sum=0; } return 0; }

2021-03-28 12:25:43 67

原创 HDU-1090 C语言

#include<stdio.h> int main() { int a,b,c; scanf("%d",&c); while(c–) { scanf("%d %d",&a,&b); printf("%d\n",a+b); } return 0; }

2021-03-21 20:50:56 266 2

空空如也

空空如也

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

TA关注的人

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