Saturday, April 25, 2020

935 A. Fafa and his Company solution


  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;cin>>n;
  6. int ans =0,em=0,lr=0,i;
  7. for(i=1;i<n;i++)
  8. {lr=i;
  9. em= n-i;
  10. if(lr+em==n and em%lr==0) ans++;
  11. }
  12.  
  13. cout<<ans;
  14. return 0; }

No comments:

Post a Comment

Aptitude test assistant programmer 2018

 #include <stdio.h> #include <stdlib.h> int main() { char str[100]; int i; int space=0;     printf("Enter a string\n")...