1. Decimal point retention in c++
#include<bits/stdc++>
using namespace std;
int main(){
float x=1.2630;
//保留一位小数
cout<<fixed<<setprecision(1);
cout<<x<<endl;
//保留两位小数
cout<<fixed<<setprecision(2);
cout<<x<<endl;
//一次类推.......
}
2. Accumulation between integers with a as the starting point and b as the ending point
#include<bits/stdc++>
using namespace std;
int main(){
int a,b,i;
for(i=a;i<=b,i++){
cout<<i;
}
}