c/c++语言开发共享C++ Primer练习题day1

“`c++ / 练习1.1略 练习1.2.改写程序,让他返回 1. 练习1.3.编写程序,在标准的输出上打印Hello,World。 / include int main() { std::cout int main() { std::cout v1 v2; std::cout …

/* 练习1.1略 练习1.2.改写程序,让他返回-1. 练习1.3.编写程序,在标准的输出上打印hello,world。 */ #include<iostream> int main() {     std::cout<<"hello,world"<<std::endl;     return 0; }
/* 练习1.4.编写程序使用乘法运算符来打印两个数的积 练习1.5 */ #include<iostream> int main() {     std::cout<<"please input two numbers:"<<std::endl;     int v1,v2;     std::cin>>v1>>v2;     std::cout<<v1<<" * "<<v2<<" = "<<v1*v2<<std::endl;     return 0; }
/*练习1.6.解释程序是否合法*/ std::cout<<"the sum of "<<v1;     <<" and "<<v2;     <<<" is "<<v1+v2<<std::endl; /* 代码不合法,缺少相应的std::cout */

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/c-cdevelopment/602521.html

(0)
上一篇 2021年5月11日
下一篇 2021年5月11日

精彩推荐