Posts

Showing posts with the label uri

Solution - Interval 2 Solution in C,C++,Python - URI / BEE CROWD 1072

  URI / BEE CROWD 1072 - Interval 2 Solution in C,C++,Python | URI - BEECROWD - BEE 1072 Solution in C,C++,Python  beecrowd | 1072 Interval 2 Adapted by Neilor Tonin, URI Brazil Timelimit: 1 Read an integer  N . This N will be the number of integer numbers  X  that will be read.   Print how many these numbers  X  are in the interval [10,20] and how many values are out of this interval. Input The first line of input is an integer  N  ( N  < 10000), that indicates the total number of test cases. Each case is an integer number  X  (-10 7  <  X  < 10 7 ).   Output For each test case, print how many numbers are in and how many values are out of the interval. Input Sample Output Sample 4 14 123 10 -25 2 in 2 out URI / BEE CROWD 1072 - Interval 2 Solution in C,C++,Python | URI - BEECROWD - BEE 1072 Solution in C,C++,Python [Solution in C++]: #include <bits/stdc++.h> using namespace ...

[Solution] Six Odd Numbers - 1070 beecrowd |

beecrowd | 1070 [Solution] C++ :  Six Odd Numbers Timelimit: 1 Read an integer value  X  and print the 6 consecutive odd numbers from  X , a value per line, including  X  if it is the case. Input The input will be a positive integer value. Output The output will be a sequence of six odd numbers. Input Sample 8 Output Sample 9 11 13 15 17 19 [Solution] C++ :  #include <bits/stdc++.h> using namespace std ; int main (){     int x ;     cin >> x ;     int c = 1 ;     for ( int i = x ; c <= 6 ; i ++ ){         if ( i % 2 != 0 ){             cout << i << endl ;             c ++ ;         }             }     return 0 ; }

Popular posts from this blog

Callback function in JavaScript

Using Generic in TypeScript about types in the Code

12 Best Websites to Practice Coding for Beginners