作者aldreamp (孟仔)
看板NTUBIME-100
标题Re: [讨论] C++考古题 第2题
时间Wed Oct 24 21:19:49 2007
※ 引述《angelwing12 (是正妹品翔)》之铭言:
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int degree2=0,degree=0;
cout<<"华式 摄氏"<<endl;
for(degree=0;degree<=245;degree+=5)
{
degree2= (degree-32)*5/9;
cout<<degree<<" "<<degree2<<endl;
}
system("PAUSE");
return 0;
}
小趴要我po的= ="
我也有一种:
#include "stdafx.h"
#include "iostream"
using namespace std;
int main()
{
int c=0,f=0;
do
{
c=(5.0/9.0)*(f-32);
cout<<c<<"\n";
f+=5;
}while(f<=245);
system("pause");
return 0;
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.183.67
1F:推 dumbolover:品翔很乖 10/24 17:29
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.192.114.2
2F:推 happierway:好像错了...他要的是对照表喔!!! 10/24 23:50
3F:推 angelwing12:不是列出来就好了吗? (大惊!!!) 10/25 00:03
4F:推 happierway:你的有列但是梦麟的没有...他只有cout一个变数而已 10/25 01:11
5F:推 happierway:现在在上计程... 10/25 16:09