convert python code to c 2b 2b online

Solutions on MaxInterview for convert python code to c 2b 2b online by the best coders in the world

showing results for - "convert python code to c 2b 2b online"
Adrian
17 Nov 2018
1name=int(input("name: "))
2
Bastian
08 Aug 2017
1    #Use input() to read input from STDIN and use print to write your output to STDOUT
2def check(s1,s2):
3    a=len(s1)
4    b=len(s2)
5    i=j=0
6    while j<a and i<b:
7        if s1[j] == s2[i]:
8            j+=1
9        i+=1
10    return j==a
11def main():
12    v=input()
13    n=int(input())
14    x=[]
15    for i in range(n):
16        x.append(input())
17    for i in x:
18        print("POSITIVE" if check(i,v) else "NEGATIVE")  
19main()
20
Silvia
26 Jul 2016
1def BitmapHoles(strArr):
2    bitmap = {}
3    for i in range(len(strArr)):
4        for j in range(len(strArr[i])):
5            bitmap[(i,j)] = int(strArr[i][j])
6    
7    hole_count = 0
8    hole = set()
9    checked = set()
10    flag = True
11    
12    for i in range(len(strArr)):
13        for j in range(len(strArr[i])):
14            stack = [(i,j)]
15            while stack:
16                coords = stack.pop()
17                if coords not in checked:
18                    checked.add(coords)
19                    if bitmap[coords] == 0 and coords not in hole:
20                        hole.add(coords)
21                        if flag == True:
22                            hole_count += 1
23                            flag = False
24                        if coords[0] - 1 >= 0 and (coords[0]-1,coords[1]) not in checked:
25                            stack.append((coords[0]-1,coords[1]))
26                        if coords[0] + 1 < len(strArr) and (coords[0]+1,coords[1]) not in checked:
27                            stack.append((coords[0]+1,coords[1]))
28                        if coords[1] - 1 >= 0 and (coords[0],coords[1]-1) not in checked:
29                            stack.append((coords[0],coords[1]-1))
30                        if coords[1] + 1 < len(strArr[coords[0]]) and (coords[0],coords[1]+1) not in checked:
31                            stack.append((coords[0],coords[1]+1))
32            flag = True
33            
34    return hole_count
Anton
10 Oct 2019
1n=int(input())
2l=list(map(int,input().split()))
3max=0
4num=l[0]
5for i in l:
6    freq=l.count(i)
7    if freq>max:
8        max=freq
9        num=i
10x=l.count(num)
11y=n-x
12print(y)
Angela
15 Sep 2018
1import java.util.*;
2
3class Program {
4  public static String caesarCypherEncryptor(String str, int key) {
5		char[] newLetters = new char[str.length()];
6		int newKey = key % 26;
7		for(int i = 0; i < str.length(); i++) {
8			newLetters[i] = getNewLetters(str.charAt(i), newKey);//A
9		}
10    return new String(newLetters);//B
11  }
12	public static char getNewLetters(char letter, int key) {
13		int  newLetterCode = letter + key;//C
14		return newLetterCode <= 122 ? (char) newLetterCode : (char) (96 + newLetterCode % 122);
15	}
16}
Giovanni
25 May 2018
1
2def ceil_function(n): 
3    res = int(n) 
4    return res if res == n or n < 0 else res+1 
5def cars(n1, n2, x): 
6    if n1>=n2: 
7        return -1 
8    rel = n2 - n1 
9    t_double = (x+1)/rel 
10    t = ceil_function(t_double) 
11    return t 
12 
13n1=int(input()) 
14n2=int(input()) 
15x=int(input()) 
16print(cars(n1, n2, x))