temperature.c

来自「把整数华氏温度转换成浮点数摄氏温度,精确到三位数字」· C语言 代码 · 共 61 行

C
61
字号
/*
*  Name:    $RCSfile$
*
*  Version: $Revision$
*
*  Created by: chensd
*
*  Purpose: This is a C language practice program
*
*  UNICATION CO. LTD. PROPRIETARY INFORMATION
*
*  SECURITY LEVEL - HIGHLY CONFIDENTIAL
*
*  DO NOT COPY
*
*  This document and the information contained in it is confidential and
*  proprietary to Unication Co., Ltd. The reproduction or disclosure in
*  whole or in part, to anyone outside of Unication Co., Ltd. without the
*  written approval of the President of Unication Co., Ltd., under a
*  Non-Disclosure Agreement, or to any employee of Unication Co. Ltd. who
*  has not previously obtained written authorization for access from the
*  individual responsible for the document, will have a significant
*  detrimental effect on Unication Co., Ltd. and is expressly prohibited.
*
*  Copyright (c) $Date$ Unication Co., Ltd.
*
*  All rights reserved
*/

#include <stdio.h>

/*
*  Name:       main
*
*  Purpose:    program entry
*
*  Params:     refer to the usage
*
*  Return:     >0 - succeed
*              -1 - met error
*
*  Note:       none
*
*/
int main(int argc, char **argv)
{
    int fahrenheit;
	double celcius;

	printf("     Fahrenheit\t    celcius\n");
	
    for(fahrenheit=0; fahrenheit<212; fahrenheit++){
		printf("%10d\t", fahrenheit);
    	celcius = 5.0/9.0*(fahrenheit-32);
	    printf("%+10.3f", celcius);
		printf("\n");
	}

	return 0;

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?