Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- int SchoolInt;
- cout << "Number of Schools: ";
- cin >> SchoolInt;
- double Schools [SchoolInt];
- for(int a = 1; a <= SchoolInt; a++)
- {
- double Students;
- cout << "Number of Students in School " << a << ": ";
- cin >> Students;
- Schools[a] = Students;
- }
- for(int a = 1; a <= SchoolInt; a++)
- {
- cout << "School " << Schools[a] << ": ";
- if(Schools[a] == 2)
- {
- cout << "School " << a << " will not be able to enter.\n";
- }
- if(Schools[a] >= 3 && Schools[a]%3)
- {
- if(Schools[a]/(-a+4) >= 2)
- {
- cout << "School " << Schools[a] << " - " << floor(Schools[a]/(-a+4)) << " teams of 3.";
- Schools[a] = floor(Schools[a]/(-a+4));
- }
- else if(Schools[a]/(-a+4) < 2)
- {
- cout << "School " << Schools[a] << " - " << floor(Schools[a]/(-a+4)) << " team of 3.";
- Schools[a] = floor(Schools[a]/(-a+4));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment