Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Stream3
//g++ 7.4.0 ////////////////////////////////////////////////////////////////////////// //Stream3 //this code is created by Rezaul Hoque on July 20,2022;contact: jewelmrh@yahoo.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; ////////////////////////////////////////////////////////////////////////////// #include <fstream> #include <iostream> #include <iomanip> #include <string> #include <strstream> //stream manipulator std::ostream& l(std::ostream& os) { return (os<<"\n"); } void fill(char c) { std::cout.width(25); std::cout.fill(c); std::cout<<l; } int main() { fill('#'); std::cout.put('J').put('u').put('l').put(' y').put(' ').put('2').put('0').put(',').put('2').put('0').put('2').put('2').put('\n'); const double hr=12.30; std::cout.setf(std::ios::showpoint); std::cout<<"\nTime: "<<hr<<" hours"<<l; std::ostrstream o; o<<":::More stream examples:::"<<l<<std::ends; o.freeze(0); std::cout<<o.str(); char a[30]="Another stream "; std::ostrstream o2(a,sizeof a,std::ios_base::app); o2<<" example :"<<std::ends; std::cout<<o2.str()<<l; o2.freeze(false); bool t,n; std::istrstream s("true false"); s>>std::boolalpha>>t>>n; std::cout<<"std::boolalpha example "<<l<<"Yes: "<<t<<" "<<" No: "<<n<<l; fill('~'); char x,y,z; std::istrstream("* % !")>>x>>y>>z; std::cout<<"std::skipws(default) :"<<l<<"x = "<<x<<l<<"y= "<<y<<l<<"z= "<<z<<l; std::cout<<"Is the above string sequence an example of std::skipws?"<<l; std::cout<<std::setfill('-')<<std::setw(15)<<std::right<<"Yes :"<<t<<l; fill('~'); std::istrstream("* % !")>>std::noskipws>>x>>y>>z; std::cout<<"std::noskipws:"<<l<<"x = "<<x<<l<<"y= "<<y<<l<<"z= "<<z<<l; std::cout<<std::left<<"Is the above string sequence an example of std::skipws?"<<l; std::cout<<std::setfill('-')<<std::setw(15)<<std::right<<"No :"<<n<<l; fill('#'); return 0; }
run
|
edit
|
history
|
help
0
UnghiLansator
Conjuntos - Contar caracteres únicos
Ploshtina na krug
dsu on tree (http://codeforces.com/contest/208/problem/E)
sample
Base File.cpp
Template arguments pack
DeltaX campus recruitment
string_match
pranav pandey