![](http://ac.namu.la/ef/ef5e604651dc0aef31c4ec9b1fded4b53d3376387cafd7cdd9b091794fa6dfff.png?expires=1718430871&key=PWmRon8icq7YjAf51bsf_w)
![](http://ac.namu.la/56/566ffdf1c17d4d22a631ad9eb29a798c976f8c57882bfe37ece5f9e24179b950.png?expires=1718430871&key=wWTQnktJE6UA8WwLdPclxw)
![](http://ac.namu.la/83/83d189ce0bcbe3004994e21e552b472174ac1917cc0641bdee68a5f8d29bd36b.png?expires=1718430871&key=ADvDwcYg2zRwQWAreHP6LQ)
#include <iostream>
using namespace std;
class circle {
int radius;
public:
circle();
~circle() {}
void setradius(int r) { radius = r; }
double getarea() { return 3.14 * radius * radius; }
};
circle::circle() {
radius = 1;
}
int main() {
cout << "생성하과 하는 원의 개수";
int n, radius;
cin >> n;
if (n <= 0)return 0;
circle* parray = new circle[n];
for (int i = 0; i < n; i++) {
cout << "원" << i + 1 << ":";
cin >> radius;
parray[i].setradius(radius);
}
int cout = 0;
circle* p = parray;
for (int i = 0; i < n; i++) {
cout << p->getarea() << ' ';
if (p->getarea() >= 100 && p->getarea() <=200)
count++;
p++;
}
cout << endl << "면적이 100에서 200 사이인 원의 개수는" << count << endl;
delete [] parray;
}