NotAlpha102

A-Trailing zeroes

May 22nd, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. main()
  4. {
  5.     ios_base::sync_with_stdio(false);
  6.     cin.tie(NULL);
  7.     int test;
  8.     cin>>test;
  9.     for(int j=1; j<=test;j++)
  10.     {
  11.         unsigned long long x, i, counter=1;
  12.         cin>>x;
  13.         if(x%2==0)
  14.         {
  15.             for(i=2;i*i<=x;i+=2)
  16.             {
  17.                 if(x%i==0)
  18.                 {
  19.                     counter++;
  20.                     //cout<<i<<' ';
  21.                 }
  22.             }
  23.         }
  24.         else
  25.         {
  26.             for(i=3;i*i<=x;i+=2)
  27.             {
  28.                 if(x%i==0)
  29.                 {
  30.                     counter++;
  31.                     //cout<<i<<' ';
  32.                 }
  33.             }
  34.  
  35.         }
  36.         cout<<"Case "<<j<<": "<<counter<<"\n";
  37.     }
  38. }
Add Comment
Please, Sign In to add comment