示例#1
0
int main(void)
{
    double fFeh;
    printf("Input temperature based on fahrenheit: ");
    scanf("%lf", &fFeh);
    printf("%.2lfF is %.2lfC, %.lfK", fFeh, Temperatures(fFeh).Celsius, Temperatures(fFeh).Kelvin);
}
示例#2
0
		Temperatures get_temperatures(BufferedIO& buffered_io) throw(boost::system::system_error,BufferedIO::TimeoutException) {
			buffered_io.write("t");
			const std::string line = strip_carriage_return(buffered_io.readStringUntil(boost::posix_time::seconds(1),"\n"));
			Json::Value reply;
			if(line.length() <= 2 || line[0] != 'T' || !Json::Reader().parse(line.substr(2), reply)) {
				return Temperatures();
			}
			return Temperatures(reply);
		}
示例#3
0
文件: 8.c 项目: wpwupingwp/c
int main(void)
{
	double input;
	if(scanf("%lf",&input));
	printf("%.2f",Temperatures(input));
	return 0;
}
示例#4
0
文件: 5_9.c 项目: RomkoPetrus/Romko
int main(void){		
	printf("This program transfer degrees Fahrenheit to Celsius and Kelvin.\n");
	printf("Enter degrees Fahrenheit: ");
	while(scanf("%lf", &Fahren) == 1){
		Temperatures(Fahren);
		printf("Enter degrees Fahrenheit (q to quit): ");		
	}	
	return 0; 
}
示例#5
0
文件: 8.c 项目: Kulbear/CAndCPP
int main(void)
{
    double Fahrenheit;
    printf("Please input the Fahrenheit:");
    
    while(scanf("%lf", &Fahrenheit) == 1)  //scanf的返回值代表成功输入的变量的数目,非数字不会被成功输入
    {
        Temperatures(Fahrenheit);
        printf("Please input the Fahrenheit:");
    }
    
    printf("end\n");
    
    return 0;
}
int main(void)
{
	double fahr;
	printf("This program converts fahrenheit to celsius and kelvin.\n");
	printf("Enter a temperature in degrees fahrenheit (q to quit): ");
	while (scanf("%lf", &fahr) == 1) // continue executing loop if user enters valid number
	{
		Temperatures(fahr); // convert fahr to celsius and kelvin

		// prompt for new input
		printf("Enter a temperature in degrees fahrenheit (q to quit): ");
	}

	printf("bye\n");
}
示例#7
0
文件: p5.9.c 项目: manishthatte/c
int main(void)
{
    printf("This program converts a given temperature from "
           "Fahrenheit scale to Celsius and Absolute scale.\n");
    printf("Please enter temperature to convert in Fahrenheit:\n");
    double F;
    while(scanf("%lf", &F) == 1)
    {
        Temperatures(F);

        printf("Do you want to convert any more temperatures?"
               "(Please enter temperature or q to quit)\n:");
    }
    details();
    return 0;
}