C/C++の宿題やらせてください。おながいします
■ このスレッドは過去ログ倉庫に格納されています
0486デフォルトの名無しさん
NGNG#include <string>
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{
int point[70][70] = {0};
ifstream ifs("in.txt");
while(ifs)
{
double x, y;
ifs >> x;
ifs.get();
ifs >> y;
point[int(floor(x*10))][int(floor(y*10))]++;
}
for(int i=0;i<70;i++)
{
for(int j=0;j<70;j++)
{
if(point[i][j])
cout << 0.1*i << "-" << 0.1*(i+1) << "," << 0.1*j << "-"
<< 0.1*(j+1) << "=" << point[i][j] << endl;
}
}
}
■ このスレッドは過去ログ倉庫に格納されています