1 条题解
-
0
C :
#include<stdio.h> main() { int a,b,c; scanf("%d",&a); if(a>10) { b=375/120; printf("%d",b+1); } else if(a>7) { c=225/120; printf("%d",c+1); } else if (a>3) printf("%d",120/75); }C++ :
#include <iostream> using namespace std; int main(){ int n,m,p; cin>>n; if(n >= 10){ m = 25 * 3 * 5; }else if(n >= 7){ m = 15 * 3 * 5; }else if(n >= 3){ m = 5 * 3 * 5; } if(m % 120 == 0){ p = m / 120; }else{ p = m / 120 + 1; } cout<<p<<endl; return 0; }Pascal :
var a,b,c:longint; begin read(a); if a>10 then b:=25*5 else if (a>=7) and (a<=10) then b:=15*5 else if (a>=3) then b:=5*5; a:=120; b:=b*3; if b mod a=0 then c:=b div a else c:=b div a+1; write(c); end.Java :
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a=sc.nextInt(); if(a>10) { if((25*3*5)%120==0){System.out.println((25*3*5)/120);} else {System.out.println((25*3*5)/120+1);} } if(a<=10&&a>7) { if((15*3*5)%120==0){System.out.println((15*3*5)/120);} else {System.out.println((15*3*5)/120+1);} } if(a<=7&&a>3) { if((5*3*5)%120==0){ System.out.println((5*3*5)/120); } else {System.out.println((5*3*5)/120+1);} } sc.close(); } }Python :
n=int(input()) if 3<= n <=6: s=5*3*5 elif 7<= n <=10: s=15*3*5 elif n > 10 : s=25*3*5 if s % 120==0 : print(s//120) else: print(s//120+1)
- 1
信息
- ID
- 290
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者