Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iso646.h>
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int a;
  8. cin » a;
  9. if ( a >= 0 && a < 10) {
  10. cout « 1 « endl;
  11. }
  12. if ( a >= 10 && a < 100) {
  13. cout « 2 « endl;
  14. }
  15. if (a >= 100 && a < 1000) {
  16. cout « 3 « endl;
  17. }
  18. if (a >= 1000 && a < 10000) {
  19. cout « 4 « endl;
  20. }
  21. if (a >= 10000 && a < 100000) {
  22. cout « 5 « endl;
  23. }
  24. if (a >= 100000 && a < 1000000) {
  25. cout « 6 « endl;
  26. }
  27. if (a >= 1000000 && a < 10000000) {
  28. cout « 7 « endl;
  29. }
  30. if (a >= 10000000 && a < 100000000) {
  31. cout « 8 « endl;
  32. }
  33. if (a >= 100000000 && a < 1000000000){
  34. cout « 9 « endl;
  35. }
  36. if( a>= 1000000000 && a < 2000000000) {
  37. cout « 10 « endl;
  38. }
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement