Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4.  
  5. char x[256], y[256];
  6.  
  7. int main()
  8. {
  9. cin>>x;
  10. cin>>y;
  11. if(strlen(x)<=strlen(y))
  12. {
  13. cout<<x<<" ";
  14. cout<<y;
  15. }
  16. else
  17. {
  18. cout<<y<<" ";
  19. cout<<x;
  20. }
  21. return 0;
  22. }
  23.  
  24.  
  25. #include<iostream>
  26. #include<cstring>
  27. using namespace std;
  28. char x[256];
  29. char y[256];
  30. char z[256];
  31. char w[6]="aeiou";
  32.  
  33. int main()
  34. {
  35. cin>>x;
  36. int i;
  37. int l1=-1;
  38. int l2=-1;
  39. for(i=0;i<strlen(x);i++)
  40. {
  41. if(strchr(w,x[i]))
  42. {
  43. y[++l1]=x[i];
  44. }
  45. else
  46. {
  47. z[++l2]=x[i];
  48. }
  49. }
  50.  
  51. cout<<y<<"\n";
  52. cout<<z;
  53. return 0;
  54. }
  55.  
  56.  
  57. #include<iostream>
  58. #include<cstring>
  59. using namespace std;
  60. char x[256];
  61. int main()
  62. {
  63. cin.getline(x, 256);
  64. int lMari=0;
  65. int lMici=0;
  66. int i;
  67. for(i=0;i<strlen(x);i++)
  68. {
  69. if(x[i]>='A' && x[i]<='Z')
  70. {
  71. lMari++;
  72. }
  73. if(x[i]>='a' && x[i]<='z')
  74. {
  75. lMici++;
  76. }
  77. }
  78. cout<<lMari<<"\n";
  79. cout<<lMici;
  80. return 0;
  81. }
  82.  
  83.  
  84. #include<iostream>
  85. #include<cstring>
  86. using namespace std;
  87. char x[256];
  88. int main()
  89. {
  90. cin>>x;
  91. int st=0;
  92. int dr=strlen(x)-1;
  93. int gresite=0;
  94.  
  95. while(st<dr)
  96. {
  97. if(x[st]!=x[dr])
  98. {
  99. gresite++;
  100. break;
  101. }
  102. st++;
  103. dr--;
  104. }
  105. if(gresite==0)
  106. {
  107. cout<<"DA";
  108. }
  109. else
  110. {
  111. cout<<"NU";
  112. }
  113. return 0;
  114.  
  115.  
  116. }
  117.  
  118.  
  119.  
  120. #include<iostream>
  121. #include<cstring>
  122. #include<climits>
  123. using namespace std;
  124. char x[256];
  125.  
  126. int main()
  127. {
  128. int n,i;
  129. cin>>n;
  130. int m;
  131.  
  132.  
  133. int lMax=INT_MIN;
  134. for(i=1; i<=n; i++)
  135. {
  136. cin>>x;
  137.  
  138. m=strlen(x);
  139. if(m>lMax)
  140. {
  141. lMax=m;
  142. }
  143. }
  144. cout<<lMax;
  145. return 0;
  146. }
  147.  
  148.  
  149.  
  150. #include<iostream>
  151. #include<cstring>
  152. using namespace std;
  153. char x[256];
  154. int main()
  155. {
  156. int i;
  157. cin.getline(x, 256);
  158. int s=0;
  159. for(i=0;i<strlen(x);i++)
  160. {
  161. if(x[i]>='0' && x[i]<='9')
  162. {
  163. s=s+x[i]-48;
  164. }
  165. }
  166. cout<<s;
  167. return 0;
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement