!!!
2024-07-13 14:47:24
发布于:浙江
题目描述
在天空之城购买地铁车票的规定如下:乘
1
1~
5
5站,
8
8元/站 ;乘
6
6 ~
10
10站,超出
5
5 站的部分
6
6元/站 ; 乘
11
11站及以上,超出
10
10 站的部分
4
4元/站。年龄
60
60 及以上者仅需半价 ,现在给出一个乘客的年龄和乘坐的站数,你需要求出这位乘客花费的钱数。
输入格式
输入两个正整数,分别表示年龄
𝑦
y 和站数
𝑛
n ,以空格隔开。
输出格式
输出一行一个正整数,表示这位乘客花费的钱数。
全部评论 9
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int y, m;
cin >> y >> m;
if(m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12){
cout << 31;
}else if(m == 2){
if(y % 4 == 0 && y % 100 != 0){
cout << "29";
}else if(y % 400 == 0){
cout << "29";
}else{
cout << "28";
}
}else{
cout << "30";
}
return 0;
}2024-07-13 来自 浙江
0#include<iostream>
using namespace std;
int main(){
int n,m=0;
cin>>n;
int t=n;
while(t){
m=m*10+t%10;
t/=10;
}
if(m==n){
cout<<"YES";
}
else{
cout<<"NO";
}
return 0;
}2024-07-13 来自 浙江
0#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
switch (n){
case 1: cout<<"weekday";break;
case 2: cout<<"weekday";break;
case 3: cout<<"weekday";break;
case 4: cout<<"weekday";break;
case 5: cout<<"weekday";break;
case 6: cout<<"weekend";break;
case 7: cout<<"weekend";break;
}
return 0;
}2024-07-13 来自 浙江
0#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a+b>c && a+c>b && b+c>a){
cout<<"yes";
}else{
cout<<"no";
}
return 0;
}2024-07-13 来自 浙江
0你个锑
2024-07-13 来自 浙江
0呃呃呃
2024-07-13 来自 广东
0你肾衰
2024-07-13 来自 浙江
0你个subway
2024-07-13 来自 浙江
0#include <bits/stdc++.h>
using namespace std;int main(){
int x,y,z;
cin>>z>>x;
if(x<=5){
y=8x;
}else if(x<11){
y=40 + 6(x-5);
}else{
y=40 + 30 + 4*(x-10);
}
if(z>=60)
y/=2;
cout<<y;
return 0;
}2024-07-13 来自 浙江
0
有帮助,赞一个