alex326

Untitled

Jan 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. problema 404
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int n,a,d=2,ok=0,c=0;
  8. cin>>n;
  9. while (n!=0){
  10. cin>>a;
  11. d=2;
  12. ok=0;
  13. while (d*d<=a && ok==0){
  14. if (a%d==0)
  15. ok=1;
  16. d++;
  17. }
  18. if (ok==0)
  19. while (a!=0){
  20. c++;
  21. a=a/10;
  22. }
  23. n--;
  24. }
  25. cout<<c;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment