- #include <iostream>标注是全部删除了
- #include <cstdio>
- using namespace std;
- int main()
- {
- folat fahr;
- folat celsius;这里有改,原来为 float fahr;
- float celsius;
- int lower,upper, step;
- lower = -70;
- upper = 70;
- step = 6;
-
- celsius = lower;
- printf("%3s %6s", "c", "f");
-
- while(celsius<=upper)
- {
- fahr = (9.0/5.0) * celsius+32.0;
- printf("%3.0f%6.0f",celsius,fahr);
- celsius = celsius+step;
- }
- return 0;
- }
复制代码 |