C语言温度

简介: #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, c...
#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {


    int i;
    int fahr,celsius;
    int lower,upper,step;
    lower = 0;//温度表的下限 
    upper = 300;//温度表的上限 
    step = 20;//步长
    
    fahr = lower;
     while(fahr<=upper){
         celsius = 5 *(fahr-32)/9;
         printf("%d\t%d\n",fahr,celsius);
         fahr=fahr+step;
    }
     scanf("%s",&i);
    return 0;
    
}

 

网名:浩秦; 邮箱:root#landv.pw; 只要我能控制一個國家的貨幣發行,我不在乎誰制定法律。金錢一旦作響,壞話隨之戛然而止。
目录
相关文章
|
1月前
|
C语言
关于使用C语言编写一个简单的温度转换程序
关于使用C语言编写一个简单的温度转换程序
32 0
|
C语言
《C语言及程序设计》实践参考——温度单位转换
返回:贺老师课程教学链接  C语言及程序设计初步  项目要求 题目:输入摄氏温度值(C),转换为华氏温度值(F)并输出提示:F=C×9/5+32,温度值取浮点数类型。 参考解答: #include &lt;stdio.h&gt; int main( ) { float f, c; printf("输入摄氏温度:"); scanf("%f", &amp;c);
986 0
|
20天前
|
程序员 编译器 C语言
C语言库函数 — 错误信息报告函数
C语言库函数 — 错误信息报告函数
18 0
|
20天前
|
程序员 C语言
C语言库函数 — 内存函数(含模拟实现内存函数)
C语言库函数 — 内存函数(含模拟实现内存函数)
30 0
|
5天前
|
C语言
C语言:内存函数(memcpy memmove memset memcmp使用)
C语言:内存函数(memcpy memmove memset memcmp使用)
|
1天前
|
C语言
pta浙大版《C语言程序设计(第3版)》 习题6-4 使用函数输出指定范围内的Fibonacci数 (20分)
pta浙大版《C语言程序设计(第3版)》 习题6-4 使用函数输出指定范围内的Fibonacci数 (20分)
|
1天前
|
C语言
pta 浙大版《C语言程序设计(第3版)》题目集 习题6-6 使用函数输出一个整数的逆序数 (20分)
pta 浙大版《C语言程序设计(第3版)》题目集 习题6-6 使用函数输出一个整数的逆序数 (20分)
|
1天前
|
C语言
(浙大版《C语言程序设计(第3版)》 习题6-5 使用函数验证哥德巴赫猜想 (20分)
(浙大版《C语言程序设计(第3版)》 习题6-5 使用函数验证哥德巴赫猜想 (20分)
|
4天前
|
安全 C语言
【C语言】strcpy与strncpy函数的使用和模拟实现
【C语言】strcpy与strncpy函数的使用和模拟实现
5 0
|
4天前
|
C语言
【C语言】字符分类函数与字符转换函数
【C语言】字符分类函数与字符转换函数
9 1