Loading... # 分析 这是一道入门的水题。简单粗暴的方法。 ## 输入 对于C++选手,推荐使用`cin`。当然也可以使用`scanf`。 ```cpp int a,b,c; cin>>a>>b>>c; ``` 或者是: ```cpp int a,b,c; scanf("%d%d%d",&a,&b,&c); ``` ## 输出 对于C++选手,推荐使用`cout`。当然也可以使用`printf`。 ```cpp cout<<a*0.2+b*0.3+c*0.5; ``` ```cpp printf("%d",a*0.2+b*0.3+c*0.5); ``` ## 源代码 ```cpp #include <iostream>//引入头文件 using namespace std;//使用命名空间std int main()//程序从这里开始 { int a,b,c;//定义三个整形变量 cin>>a>>b>>c;//输入三个数 cout<<a*0.2+b*0.3+c*0.5;//输出运算结果 return 0;//愉快的结束程序。 } ``` <hr class="content-copyright" style="margin-top:50px" /><blockquote class="content-copyright" style="font-style:normal"><p class="content-copyright">版权属于:淡淡的路瑶</p><p class="content-copyright">本文链接:<a class="content-copyright" href="https://www.starroad.top/archives/P3954.html">https://www.starroad.top/archives/P3954.html</a></p><p class="content-copyright">如果文章出现任何问题,请下方评论,紧急情况请发邮件。谢谢支持!</p></blockquote> Last modification:February 20th, 2021 at 11:03 am © 允许规范转载 Support 如果您觉得我的文章有用,给颗糖糖吧~ ×Close Appreciate the author Sweeping payments Pay by AliPay Pay by WeChat