poj 2871 A Simple Question of Chemistry
2016-11-13 23:01
197 查看
题意:输入一系列温度,输出2个温度之间的差别
思路:两两相减得到温度差即可
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
float a[1000];
int i=0;
while(scanf("%f",&a[i])&&a[i]<900){
scanf("%f",&a[++i]);
i++;
}
for(int j=1;j<i;j++)
printf("%.2f\n",a[j]-a[j-1]);
printf("End of Output\n");
}
思路:两两相减得到温度差即可
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
float a[1000];
int i=0;
while(scanf("%f",&a[i])&&a[i]<900){
scanf("%f",&a[++i]);
i++;
}
for(int j=1;j<i;j++)
printf("%.2f\n",a[j]-a[j-1]);
printf("End of Output\n");
}
相关文章推荐
- POJ 2871 A Simple Question of Chemistry(我的水题之路——数列两数之差 )
- POJ 2871 A Simple Question of Chemistry(水题)
- POJ 2871 A Simple Question of Chemistry(水~)
- poj 2871 A Simple Question of Chemistry
- poj 2871 A Simple Question of Chemistry
- poj 2871 A Simple Question of Chemistry
- 1763 A Simple Question of Chemistry
- zoj 1763 A Simple Question of Chemistry(洪水!)
- zoj 1763 A Simple Question of Chemistry
- ZOJ 1763 A Simple Question of Chemistry
- zoj 1763 A Simple Question of Chemistry
- 1763_A Simple Question of Chemistry
- poj2871 A Simple Question of Chemistry(水题)
- zoj 1763 A Simple Question of Chemistry
- poj2871 A Simple Question of Chemistry
- zoj1763-----------A Simple Question of Chemistry
- ZOJ Problem Set–1763 A Simple Question of Chemistry
- ZOJ 1763: A Simple Question of Chemistry 【位数问题setprecision】
- zoj 1763 A Simple Question of Chemistry
- zju1763一个简单的化学问题A Simple Question of Chemistry