首页 > 其他 > 详细

做题小技巧

时间:2018-02-27 22:14:12      阅读:197      评论:0      收藏:0      [点我收藏+]

正常的输入

C++:

cin>>

python:

input() 如果用list(input())可以将输入的字符或者数字一个一个分成一个列表

按行输入

C++:

getline(cin,a)

python:

import sys

sys.stdin.readlines():

C++中想要删掉一个string中的空格号

if(!s.empty())
{
       while( (index = s.find(‘ ‘,index)) != string::npos)
       {
            s.erase(index,1);
        }

}

C++

#include <iomanip>
cout << setprecision(1) << fixed << (sum/TIMES) << endl;

做题小技巧

原文:https://www.cnblogs.com/daibigmonster/p/8480902.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!