Advertisement
Guest User

zxc

a guest
Oct 22nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. struct Address
  6. {
  7. int sss[10];
  8. int postalcode;
  9. string firstname;
  10. string lastname;
  11. string address;
  12. string city;
  13. string state;
  14. string province;
  15. };
  16.  
  17. int main()
  18. {
  19. int a=1;
  20. int count = 0;
  21. int size;
  22. struct Address address1;
  23.  
  24. cout << "Enter SSS #: ";
  25. cin >> address1.sss[0];
  26.  
  27. if(address1.sss[0]==1)
  28. {
  29. cout << "The first number is Odd";
  30. for(int i=1; i<=3; i++)
  31. {
  32. cin >> address1.sss[0];
  33. if(address1.sss[0]==1||3||5||7||9)
  34. {
  35. cout << "The first number is Odd";
  36. }
  37. else if(address1.sss[0]==2||4||6||8)
  38. {
  39. break;
  40. }
  41. }
  42. }
  43. size = sizeof(address1.sss)/sizeof(address1.sss[0]);
  44. if(size<=7)
  45. {
  46. cout << "The number is less than 8";
  47. for(int i=1; i<=3; i++)
  48. {
  49. cout << "\nEnter SSS #: ";
  50. cin >> address1.sss[0];
  51. size = sizeof(address1.sss)/sizeof(address1.sss[0]);
  52. if(size<=7)
  53. {
  54. cout << "The number is less than 8";
  55. }
  56. if(size==8)
  57. {
  58. cout << "The number length is 8";
  59. break;
  60. }
  61. }
  62. }
  63. else if(size==8)
  64. {
  65. cout << "The number length is 8";
  66. }
  67. a++;
  68.  
  69. system("pause>0");
  70. return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement