今天仍然在整理pta的题目,还时挺慢的,今天整理到第40题了,下午的时候雨停了,去路上练了一会车,为科目三做准备
#include <iostream> using namespace std; int main() { int n; cin >> n; double sum = 0; for(int i = 0; i < n; i++){ double t; cin >> t; sum += 1.0/t; } printf("%.2f", 1.0/(sum/n)); }
#include<stdio.h> int main() { int lowest,yu; int a[4]; int max=0; int m=0; int check=0; for(int i=0;i<4;i++) { scanf("%d",&a[i]); if(a[i]>max) { max=a[i]; } } scanf("%d %d",&lowest,&yu); for(int n=0;n<4;n++) { if(max-a[n]>yu||a[n]<lowest) { m++; check=n; } } if(m==0) { printf("Normal"); } else if(m==1) { printf("Warning: please check #%d!",check+1); } else { printf("Warning: please check all the tires!"); } return 0; }
标签:lowest,7.31,1.0,int,sum,main From: https://www.cnblogs.com/xuxingkai/p/17594564.html