C++
文章平均质量分 55
Aaron_Yang.
大三软件工程在读,欢迎学习交流,一起进步
展开
-
POJ 1505 题解
Description:Before the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by so called scribers. The scriber had been given a book and after several months he finished its copy. One of the原创 2021-10-12 09:53:44 · 330 阅读 · 0 评论 -
HDU 1969 题解
Problem DescriptionMy birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This shoul原创 2021-10-12 09:48:33 · 232 阅读 · 0 评论 -
C++加快输入输出的方法
初衷:做题的时候,经常会遇到cin输入超时,而换成C语言的scanf全都AC通过的情况,找了一些资料,贴上以下代码,可以极大地减少cin输入所消耗的时间(可以和scanf差不多)ps:在PTA里,经常出现数据集超大造成 cin超时的情况。这时候大部分人(包括原来我也是)认为这是cin的效率不及scanf的错,甚至还上升到C语言和C++语言的执行效率层面的无聊争论。其实,这只是C++为了兼容而采取的保守措施。我们可以在IO之前将stdio解除绑定,这样做了之后要注意不要同时混用cout和printf之类原创 2021-08-16 10:44:19 · 1825 阅读 · 0 评论 -
C++ 字符串转换为数字(stoi,stoll,stof,stod)
记忆方法:sto+你要的字符类型一、stoi()将字符串转换为整型#include<iostream>#include<string>using namespace std; int main(){ int n; string s1="89"; n=stoi(s1); cout<<n<<endl; return 0;} 二、stoll()将字符串转换为long long#include<i转载 2021-07-13 09:09:39 · 5022 阅读 · 0 评论 -
C++中to_string函数的用法
to_string 函数:将数字常量转换为字符串,返回值为转换完毕的字符串头文件:#include < string >(必须加)string s = to_string(i); //将整数i转换为字符串表示形式string to_string (int val);string to_string (long val);string to_string (long long val);string to_string (unsigned val);string to_string转载 2021-07-13 09:06:04 · 18298 阅读 · 4 评论