Flowchart (ISO 5807)
Source code
C++
void perfect(int n) {
int sum = 0;
for (int i = 1; i < n; i++) {
if (n % i == 0) {
sum += i;
}
}
if (sum == n) {
cout << "Досконале";
} else {
cout << "Ні";
}
}The editor opens with this code — change it and the chart redraws.
- Language
- C++
- Constructs
- sum of divisors
- Topic
- Loops
- Formats
- Word, Visio, draw.io, PDF, SVG