int round(string num, string cutoff) {
stringstream ss,ss2;
int i;
double f,c;
ss << num;
ss >> f;
ss2 << cutoff;
ss2 >> c;
i = int(f);
if(f-i > c) i++;
return i;
}
それだけ
int round(string num, string cutoff) {
stringstream ss,ss2;
int i;
double f,c;
ss << num;
ss >> f;
ss2 << cutoff;
ss2 >> c;
i = int(f);
if(f-i > c) i++;
return i;
}
それだけ