Skip to content

Instantly share code, notes, and snippets.

@pinglunliao
Last active November 5, 2019 08:38
Show Gist options
  • Save pinglunliao/48a38c240c42e5003012 to your computer and use it in GitHub Desktop.
Save pinglunliao/48a38c240c42e5003012 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
int num;
int i = 0;
int result[3] = { 0, 0, 0 };
cin >> num;
while(i < num)
{
int in;
cin >> in;
result[in % 3]++;
i++;
}
cout << result[0] << " " << result[1] << " " << result[2] << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment