您的位置:首页 > 汽车 > 新车 > 网络建设与运维技能大赛_如何设计软件_阿里指数_seo方案怎么做

网络建设与运维技能大赛_如何设计软件_阿里指数_seo方案怎么做

2025/10/26 12:40:03 来源:https://blog.csdn.net/MYX_309/article/details/145972540  浏览:    关键词:网络建设与运维技能大赛_如何设计软件_阿里指数_seo方案怎么做
网络建设与运维技能大赛_如何设计软件_阿里指数_seo方案怎么做

1.姓名和地址

#include <iostream>
using namespace std;
int main() 
{string name;cout << "请输入姓名:";cin >> name;string dress;cout << "请输入地址:";cin >> dress;cout << "您的姓名是:" << name << ";地址是:" << dress << endl;return 0;
}

2.距离转换

#include <iostream>
using namespace std;
int main() 
{int l;cout << "请输入以long为单位的距离:";cin >> l;int m = 220 * l;cout << l << "long = " << m << "码";return 0;
}

3.输出

#include <iostream>
using namespace std;void mice(void)
{cout << "three blind mice"<<endl;
}
void run(void)
{cout << "see how they run"<<endl;
}
int main() 
{mice();mice();run();run();return 0;
}

4.年龄

#include <iostream>
using namespace std;int nianling(int age)
{return age * 12;
}
int main() 
{int age;cout << "请输入年龄"<<endl;cin >> age;cout << "您的年龄包含" << nianling(age) << "个月" << endl;return 0;
}

5.温度转换

#include <iostream>
using namespace std;
double temperature(double wendu)
{return 1.8*wendu+32;
}
int main() 
{double wendu;cout << "请输入摄氏温度:"<<endl;cin >> wendu;cout << wendu<<"摄氏度相当于" << temperature(wendu) << "华氏度" << endl;return 0;
}

6.光年天文单位转换

#include <iostream>
using namespace std;
double convert(double guangnian)
{return 63240*guangnian;
}
int main() 
{double guangnian;cout << "请输入光年:"<<endl;cin >> guangnian;cout << guangnian<<"光年 =" << convert(guangnian) << "天文单位" << endl;return 0;
}

7.时间

#include <iostream>
using namespace std;
void xianshi(int hour,int minute)
{cout << "Time:" << hour << ":" << minute << endl;
}
int main() 
{int hour;cout << "请输入小时数:";cin >> hour;int minute;cout << "请输入分钟数:";cin >> minute;xianshi(hour, minute);return 0;
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com