Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- int test;
- cin>>test;
- for(int j=1; j<=test;j++)
- {
- unsigned long long x, i, counter=1;
- cin>>x;
- if(x%2==0)
- {
- for(i=2;i*i<=x;i+=2)
- {
- if(x%i==0)
- {
- counter++;
- //cout<<i<<' ';
- }
- }
- }
- else
- {
- for(i=3;i*i<=x;i+=2)
- {
- if(x%i==0)
- {
- counter++;
- //cout<<i<<' ';
- }
- }
- }
- cout<<"Case "<<j<<": "<<counter<<"\n";
- }
- }
Add Comment
Please, Sign In to add comment