input:
4
after
a b c d
f e f g
t e r r
a b i j
output wants to come : [(0, 0),(1, 0),(2, 0),(2, 1),(2, 2)]
4
search
s e a c
r c c c
h e e e
h e e e
output wants to come: "Not Present"
Ravans dream in to win the Tic Tac Toe campionship to accomplish this he practices alone at home to learn the strategies the game .your tast is to identify the cell where Ravan should place the third piece so that the wins the game Assume the each cell in the tic tac toe board in marked a number as shown in the table below
0 1 2
3 4 5
6 7 8
the first line of input contains space-seperated integers representing the cells where Ravan his first two pieces
the output should be single integers representing cell where Ravanshould places his final place
sample input 1
0 1
sample output 1
2
sample output 2
0 3
sample output 2
6
4. Create a program that will plot the equation of the line y=mx+b using an array.
array1 ==> x - input by user
m = constant - input by user
b = constant - input by user
array2 ==> y - computed
Create a program with a one-dimensional array that searches for a number within the array, and how many times the number appears on the array.
by CodeChum Admin
I’ve been too positive in life, but I figured that it really isn’t good to always be positive since life has to be balanced, don’t you think so?
That aside, let’s make a program that asks for random integers, positive or negative, and sums up all the negative integers only! Well, the loop stops when the inputted value is 0, though.
And don’t forget to print the sum of negative integers afterwards! Thanks!
Input
1. A series of integers
Output
Multiple lines containing message prompts to input integers.
The last line contain the sum of the negative integers.
Enter·n:·1
Enter·n:·3
Enter·n:·-1
Enter·n:·-2
Enter·n:·-4
Enter·n:·5
Enter·n:·-1
Enter·n:·-2
Enter·n:·0
Sum·of·negatives·=·-10by CodeChum Admin
The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.
Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.
Off you go!
Input
1. First integer
2. Second integer
Output
The first line will contain a message prompt to input the first integer.
The second line will contain a message prompt to input the second integer.
The last line contains the GCD of the two integers.
Enter·the·first·integer:·6
Enter·the·second·integer:·9
GCD·of·6·and·9·is·3by CodeChum Admin
I'm really fond of even numbers, you know? That's why I'll be letting you make another even number problem yet again. This time, you need to print from a range of two inputted numbers, n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order.
How about that?
Input
1. Value of n1
2. Value of n2
Output
The first line will contain a message prompt to input the value of n1.
The second line will contain a message prompt to input the value of n2.
The succeeding lines contain an integer.
Enter·n1:·3
Enter·n2:·10
10
8
6
4by CodeChum Admin
As I've said before, there are three types of numbers: the positive, the zero, and the negative ones. Today, we shall pay attention only to the negative ones now. Make a loop that will accept random decimal/float numbers. When the user inputs 0, the loop will terminate and then output the sum of all negative numbers inputted in 3 decimal places.
Let's code this.
Input
1. A series of decimal numbers
Output
The first lines will contain message prompts to input the decimal numbers.
The last line contains the sum of all negative numbers with 3 decimal places.
Enter·a·number:·2.4434
Enter·a·number:·-1.3433
Enter·a·number:·-2.444
Enter·a·number:·6.432
Enter·a·number:·0
Sum·of·all·negatives·=·-3.787by CodeChum Admin
Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll be asking for a random integer and then loop from 1 until that integer. Then, implement these conditions in the game:
Input
1. An integer
Output
The first line will contain a message prompt to input the integer.
The succeeding lines will contain either a string or an integer.
Enter·n:·15
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzzby CodeChum Admin
Make a program that will accept an integer and loop from 1 to that integer. Then, print all numbers from that range that are greater than 3.
Let's go!
Input
1. An integer
Output
The first line will contain a message prompt to input the integer.
The succeeding lines contain an integer.
Enter·n:·8
4
5
6
7
8