Advertisement
Josif_tepe

Untitled

Dec 15th, 2021
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.93 KB | None | 0 0
  1. /* Code generated && tested by LizardCode for CodeFu */
  2. #include <limits.h>
  3. #include <vector>
  4. #include <sstream>
  5. #include <iostream>
  6. #include <algorithm>
  7. #include <cstring>
  8. #include <string>
  9. #include <cstdlib>
  10. #include <cstdio>
  11. #include <map>
  12. #include <list>
  13. #include <queue>
  14. #include <set>
  15.  
  16. using namespace std;
  17.  
  18. class IpAddresses
  19. {
  20.   public:
  21.  
  22.     int count( string S, int K )
  23.     {
  24.      
  25.      
  26.     }
  27. };
  28.  
  29. const int Test_No=0;
  30.  
  31. int main()
  32. {
  33.   IpAddresses tmp;
  34.   int res;
  35.   string S;
  36.   int K;
  37. /***************************Test 1 ********************************/
  38.  
  39. if(Test_No==0 || Test_No==1){
  40. S = "1234567";
  41. K = 3;
  42. res = tmp.count(S,K);
  43. if(res == 1) cout<<"test #"<<1<<" Correct!\n\n";
  44.   else {cout<<"test #"<<1<<" Wrong!\n";
  45. cout<<"Expected: "<<1<<"\n";
  46. cout<<"Recieved: "<< res <<" \n\n";}
  47. cout<<"---------------------------------------------"<<"\n";
  48.  
  49. }
  50. /******************************************************************/
  51.  
  52.  
  53. /***************************Test 2 ********************************/
  54.  
  55. if(Test_No==0 || Test_No==2){
  56. S = "100111";
  57. K = 3;
  58. res = tmp.count(S,K);
  59. if(res == 3) cout<<"test #"<<2<<" Correct!\n\n";
  60.   else {cout<<"test #"<<2<<" Wrong!\n";
  61. cout<<"Expected: "<<3<<"\n";
  62. cout<<"Recieved: "<< res <<" \n\n";}
  63. cout<<"---------------------------------------------"<<"\n";
  64.  
  65. }
  66. /******************************************************************/
  67.  
  68.  
  69. /***************************Test 3 ********************************/
  70.  
  71. if(Test_No==0 || Test_No==3){
  72. S = "345678";
  73. K = 2;
  74. res = tmp.count(S,K);
  75. if(res == 0) cout<<"test #"<<3<<" Correct!\n\n";
  76.   else {cout<<"test #"<<3<<" Wrong!\n";
  77. cout<<"Expected: "<<0<<"\n";
  78. cout<<"Recieved: "<< res <<" \n\n";}
  79. cout<<"---------------------------------------------"<<"\n";
  80.  
  81. }
  82. /******************************************************************/
  83.  
  84.  
  85. /***************************Test 4 ********************************/
  86.  
  87. if(Test_No==0 || Test_No==4){
  88. S = "25525511135";
  89. K = 4;
  90. res = tmp.count(S,K);
  91. if(res == 2) cout<<"test #"<<4<<" Correct!\n\n";
  92.   else {cout<<"test #"<<4<<" Wrong!\n";
  93. cout<<"Expected: "<<2<<"\n";
  94. cout<<"Recieved: "<< res <<" \n\n";}
  95. cout<<"---------------------------------------------"<<"\n";
  96.  
  97. }
  98. /******************************************************************/
  99.  
  100.  
  101. /***************************Test 5 ********************************/
  102.  
  103. if(Test_No==0 || Test_No==5){
  104. S = "0000";
  105. K = 4;
  106. res = tmp.count(S,K);
  107. if(res == 1) cout<<"test #"<<5<<" Correct!\n\n";
  108.   else {cout<<"test #"<<5<<" Wrong!\n";
  109. cout<<"Expected: "<<1<<"\n";
  110. cout<<"Recieved: "<< res <<" \n\n";}
  111. cout<<"---------------------------------------------"<<"\n";
  112.  
  113. }
  114. /******************************************************************/
  115.  
  116.  
  117. /***************************Test 6 ********************************/
  118.  
  119. if(Test_No==0 || Test_No==6){
  120. S = "0000";
  121. K = 3;
  122. res = tmp.count(S,K);
  123. if(res == 0) cout<<"test #"<<6<<" Correct!\n\n";
  124.   else {cout<<"test #"<<6<<" Wrong!\n";
  125. cout<<"Expected: "<<0<<"\n";
  126. cout<<"Recieved: "<< res <<" \n\n";}
  127. cout<<"---------------------------------------------"<<"\n";
  128.  
  129. }
  130. /******************************************************************/
  131.  
  132.  
  133. /***************************Test 7 ********************************/
  134.  
  135. if(Test_No==0 || Test_No==7){
  136. S = "1111111111";
  137. K = 10;
  138. res = tmp.count(S,K);
  139. if(res == 1) cout<<"test #"<<7<<" Correct!\n\n";
  140.   else {cout<<"test #"<<7<<" Wrong!\n";
  141. cout<<"Expected: "<<1<<"\n";
  142. cout<<"Recieved: "<< res <<" \n\n";}
  143. cout<<"---------------------------------------------"<<"\n";
  144.  
  145. }
  146. /******************************************************************/
  147.  
  148.  
  149. /***************************Test 8 ********************************/
  150.  
  151. if(Test_No==0 || Test_No==8){
  152. S = "1111111111";
  153. K = 7;
  154. res = tmp.count(S,K);
  155. if(res == 77) cout<<"test #"<<8<<" Correct!\n\n";
  156.   else {cout<<"test #"<<8<<" Wrong!\n";
  157. cout<<"Expected: "<<77<<"\n";
  158. cout<<"Recieved: "<< res <<" \n\n";}
  159. cout<<"---------------------------------------------"<<"\n";
  160.  
  161. }
  162. /******************************************************************/
  163.  
  164.  
  165. /***************************Test 9 ********************************/
  166.  
  167. if(Test_No==0 || Test_No==9){
  168. S = "1110000111";
  169. K = 5;
  170. res = tmp.count(S,K);
  171. if(res == 1) cout<<"test #"<<9<<" Correct!\n\n";
  172.   else {cout<<"test #"<<9<<" Wrong!\n";
  173. cout<<"Expected: "<<1<<"\n";
  174. cout<<"Recieved: "<< res <<" \n\n";}
  175. cout<<"---------------------------------------------"<<"\n";
  176.  
  177. }
  178. /******************************************************************/
  179.  
  180.  
  181. /***************************Test 10 ********************************/
  182.  
  183. if(Test_No==0 || Test_No==10){
  184. S = "1110000111";
  185. K = 6;
  186. res = tmp.count(S,K);
  187. if(res == 6) cout<<"test #"<<10<<" Correct!\n\n";
  188.   else {cout<<"test #"<<10<<" Wrong!\n";
  189. cout<<"Expected: "<<6<<"\n";
  190. cout<<"Recieved: "<< res <<" \n\n";}
  191. cout<<"---------------------------------------------"<<"\n";
  192.  
  193. }
  194. /******************************************************************/
  195.  
  196.  
  197.   return 0;
  198.  
  199. }
  200.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement