
【入门2】分支结构
dllglvzhenfeng
这个作者很懒,什么都没留下…
展开
-
P1422 小玉家的电费--2022.03.15
/*P1422 小玉家的电费--2022.03.15https://www.luogu.com.cn/problem/P1422*/#include <bits/stdc++.h>using namespace std;int main( void ){ double ans; int x; cin>>x; if(x<=150) { ans=x*0.4463; } else { if( x<=400) { ans.原创 2022-03-15 21:57:45 · 303 阅读 · 0 评论 -
P1909 [NOIP2016 普及组] 买铅笔(python3实现)
https://www.luogu.org/problem/P1909"""P1909 [NOIP2016 普及组] 买铅笔https://www.luogu.org/problem/P1909"""min=0x7fffffffn=int(input())for i in range(1,4): num,price=map(int,input().split()) if n%num==0:原创 2022-02-01 11:41:34 · 664 阅读 · 0 评论 -
P1424 小鱼的航程(改进版) -- python3实现
https://www.luogu.com.cn/problem/P1424"""P1424 小鱼的航程(改进版)https://www.luogu.com.cn/problem/P1424"""ans=0x,n=map(int,input().split())for i in range(n): if x!=6 and x!=7: ans+=250 if x==7:原创 2022-02-01 13:52:00 · 1098 阅读 · 0 评论 -
P1085 [NOIP2004 普及组] 不高兴的津津(python3实现)
https://www.luogu.com.cn/problem/P1085"""P1085 [NOIP2004 普及组] 不高兴的津津-2022.02.01https://www.luogu.com.cn/problem/P1085"""max=0day=0for i in range(1,8): a,b=map(int,input().split()) s=a+b if s>max and s>原创 2022-02-01 11:31:13 · 1423 阅读 · 0 评论 -
P1046 [NOIP2005 普及组] 陶陶摘苹果(python3实现)
https://www.luogu.com.cn/problem/P1046"""P1046 [NOIP2005 普及组] 陶陶摘苹果(python3实现)https://www.luogu.com.cn/problem/P1046"""ans=0a=list(map(int,input().split()))b=int(input())for i in range(10): if a[i]<=b+30: ans+=原创 2022-02-01 14:32:44 · 456 阅读 · 0 评论 -
P1422 小玉家的电费(python3实现)
https://www.luogu.com.cn/problem/P1422"""P1422 小玉家的电费https://www.luogu.com.cn/problem/P1422"""a=int(input())if a<151: b=a*0.4463 print("%.1f"%b)if a>150 and a<401: b=(a-150)*0.4663 c=15原创 2022-02-01 13:34:16 · 558 阅读 · 0 评论 -
P1888 三角函数(python3实现)
https://www.luogu.com.cn/problem/P1888"""P1888 三角函数https://www.luogu.com.cn/problem/P1888"""def gcd(x,y): z=y while x%y!=0: z=x%y x=y y=z r原创 2022-02-01 14:15:56 · 496 阅读 · 0 评论 -
P1055 [NOIP2008 普及组] ISBN 号码(python3实现)
https://www.luogu.com.cn/problem/P1055"""P1055 [NOIP2008 普及组] ISBN 号码https://www.luogu.com.cn/problem/P1055"""mod="0123456789X"a=list(input())#print(a)t=0j=1for i in range(12): if a[i]=='-': continue原创 2022-02-01 13:04:55 · 788 阅读 · 0 评论 -
P4414 [COCI2006-2007#2] ABC(python3实现)
https://www.luogu.com.cn/problem/P4414"""P4414 [COCI2006-2007#2] ABC 02(python3实现)https://www.luogu.com.cn/problem/P4414"""import sysa=list(map(int,input().split()))b=list(input())#print(b)a.sort()for i in range(3): if ord(b[i]原创 2022-02-01 16:00:55 · 747 阅读 · 0 评论 -
P5714 【深基3.例7】肥胖问题--python3实现
https://www.luogu.com.cn/problem/P5715"""P5714 【深基3.例7】肥胖问题--AChttps://www.luogu.com.cn/problem/P5715"""m,h=list(input().split())m=float(m)h=float(h)h=h*hbmi=m/hif bmi<18.5: print("Underweight")else: if bmi&l原创 2022-01-27 10:29:24 · 632 阅读 · 0 评论 -
P5716 【深基3.例9】月份天数(python3实现)
https://www.luogu.com.cn/problem/P5716"""P5716 【深基3.例9】月份天数https://www.luogu.com.cn/problem/P5716"""a=[0,31,28,31,30,31,30,31,31,30,31,30,31]#print(a)year,month=map(int,input().split())if (year%4==0) and (year%100!=0): a[2]=29原创 2022-01-27 21:41:33 · 384 阅读 · 0 评论 -
P5710 【深基3.例2】数的性质(python3实现)
https://www.luogu.com.cn/problem/P5710"""P5710 【深基3.例2】数的性质https://www.luogu.com.cn/problem/P5710"""a=0b=0c=0d=0k=0n=int(input())if n%2==0: k+=1if n>4 and n<=12: k+=1if k==2: a=1if k>0:原创 2022-01-29 02:39:34 · 766 阅读 · 0 评论 -
P5712 【深基3.例4】Apples(python3实现)
https://www.luogu.com.cn/problem/P5712"""P5712 【深基3.例4】Appleshttps://www.luogu.com.cn/problem/P5712"""x=int(input())print("Today, I ate %d" %x,end=" apple")if x!=0 and x!=1: print("s",end="")print(".")原创 2022-01-27 00:01:51 · 344 阅读 · 0 评论 -
P5711 【深基3.例3】闰年判断(python3实现)
https://www.luogu.com.cn/problem/P5711"""P5711 【深基3.例3】闰年判断https://www.luogu.com.cn/problem/P5711"""year=int(input())if year%4==0: if year%100==0: if year%400==0: leap=1原创 2022-01-27 00:18:03 · 447 阅读 · 0 评论 -
P5715 【深基3.例8】三位数排序(python3实现)
https://www.luogu.com.cn/problem/P5715"""P5715 【深基3.例8】三位数排序https://www.luogu.com.cn/problem/P5715"""a,b,c=list(map(int,input().split()))if a>b: a,b=b,aif a>c: a,c=c,aif b>c: b,c=c,bprint(a,end='原创 2022-01-27 09:57:11 · 752 阅读 · 0 评论 -
P5713 【深基3.例5】洛谷团队系统(python3实现)
https://www.luogu.com.cn/problem/P5713"""P5713 【深基3.例5】洛谷团队系统https://www.luogu.com.cn/problem/P5713"""a=int(input())if a*5 <= (a*3+11): print("Local")else: print("Luogu")原创 2022-01-30 10:57:22 · 400 阅读 · 0 评论 -
P5717 【深基3.习8】三角形分类(python3实现)
https://www.luogu.com.cn/problem/P5717"""P5717 【深基3.习8】三角形分类(python3实现)https://www.luogu.com.cn/problem/P5717"""import sysa=list(map(int,input().split()))a.sort()if a[0]+a[1]<=a[2]: print("Not triangle") sys.exit(0)原创 2022-02-01 15:09:00 · 1138 阅读 · 1 评论 -
洛谷 深基 第1部分 语言入门 第2章 顺序结构程序设计
P5703 【深基2.例5】苹果采购【深基2.例5】苹果采购 - 洛谷P5704 【深基2.例6】字母转换【深基2.例6】字母转换 - 洛谷P5705 【深基2.例7】数字反转【深基2.例7】数字反转 - 洛谷P5706 【深基2.例8】再分肥宅水【深基2.例8】再分肥宅水 - 洛谷P1425 小鱼的游泳时间小鱼的游泳时间 - 洛谷P1425 小鱼的游泳时间(python3实现)P1425 小鱼的游泳时间(python3实现)_青少年趣味编程-原创 2022-02-13 20:57:36 · 563 阅读 · 0 评论 -
P5712 【深基3.例4】Apples(python3 C++ Scratch实现)
【深基3.例4】Apples - 洛谷python3代码:"""P5712 【深基3.例4】Apples(python3实现)https://www.luogu.com.cn/problem/P5712"""x=int( input() )if x==0 or x==1: print("Today, I ate %d apple."%x) else: print("Today, I原创 2022-02-08 18:56:21 · 695 阅读 · 0 评论