Horje
code converter java to C Code Example
code converter java to C
import java.util.HashSet;
import java.util.Scanner;

class SerenaFlowers{
    public static void main(String args[])
    {
         Scanner sc = new Scanner(System.in);
         int n = sc.nextInt(); 
         int k = sc.nextInt(); 
         sc.nextLine(); 
         int arr[] = new int[n]; 
         String a[] = sc.nextLine().split(" ");
         HashSet hs = new HashSet<>();
         for(int i =0 ; i < a.length ; i++)
         {
             arr[i] = Integer.parseInt(a[i]); 
             if(i<k)
                 hs.add(arr[i]);
         }
         System.out.println(hs.size());
    }
}
code converter java to C
import java.util.LinkedList;
import java.util.List;
class SuffixTrieNode {
 
    final static int MAX_CHAR = 256;
 
    SuffixTrieNode[] children = new SuffixTrieNode[MAX_CHAR];
    List<Integer> indexes;
code converter java to c
import java.math.BigInteger;
import java.util.Scanner;

public class Chooser
{
BigInteger num;
  
public static BigInteger findNumber(Chooser c)
{
Scanner s = new Scanner(System.in);
while(true)
{
System.out.println("choose a number (greater than zero): ");
c.num = s.nextBigInteger();
if(c.num.compareTo(BigInteger.valueOf(0))>0)
break;
}
return c.num;
}
  
  
  
  
  
  
  
  
  
  
  
  
public String guess(BigInteger number)
{
Scanner s = new Scanner(System.in);
while(true){
System.out.println("enter a guess: ");
this.num = s.nextBigInteger();
if(this.num.compareTo(number) == 0)
return "your answer is correct";
else if(this.num.compareTo(number) == 1)
return "the correct answer is lower";
else// (this.num.compareTo(number)== -1)
return "the correct answer is higher";
}
}
  
public static void main(String[] args)
{
Chooser choose = new Chooser();
BigInteger num = Chooser.findNumber(choose);
  
String guess = choose.guess(num);
while(true){
  
if(!guess.equalsIgnoreCase("your answer is correct"))
{
System.out.println(guess);
guess = choose.guess(num);
}
else
{
System.out.println(guess);
return;
}
}
}
}
code converter java to C
package demo;

import com.mtsystems.coot.IntContainer;
import com.mtsystems.coot.NativeHelper;
import com.mtsystems.coot.String8;

public class DemoTranslation {
	static {
		// The online demo uses the example library "libc.so.6".
		// Have a look at the translated programs for real values.
		NativeHelper h = NativeHelper.get("libc.so.6");
		h.bindDirect(DemoTranslation.class);
	}

	public static native int readinput(String8 arg1, String8 arg2, IntContainer arg3);

	public static native int printoutput(String8 arg1, String8 arg2, IntContainer arg3);

	public static void main(String[] args) {
		String8[] fname = new String8[3], lname = new String8[3];
		IntContainer[] marks = new IntContainer[3];






		System.out.print("Hello World");
	}
}
code converter java to C
import java.util.LinkedList;
import java.util.List;
class SuffixTrieNode {
 
    final static int MAX_CHAR = 256;
 
    SuffixTrieNode[] children = new SuffixTrieNode[MAX_CHAR];
    List<Integer> indexes;
code converter java to C
package train;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        System.out.println("Please enter your name");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("Welcome" + name);

    }
}
code converter java to C
<strong>import java.util.Arrays;
class problem9 {
    public static void main(String[] args) {
</strong>
<strong>
        System.out.println("The main method is starting here ");</strong>
<strong>
        int array1[] = { 1, 3, 5, 4, 8, 6, 7, 100, 99, 88, 97 };
        System.out.println("The original array is : " + Arrays.toString(array1));</strong>
        // sorting array elemets in decending order <strong>
        for (int i = 0; i &lt; array1.length - 1; i++) {
            if (array1[i] &lt; array1[i + 1]) {
                int temp = array1[i];
                array1[i] = array1[i + 1];
                array1[i + 1] = temp;
                // important line of this code
                i = -1;
            }
        }
        System.out.println("The sorted array is : " + Arrays.toString(array1));
        int k = 3;
        int res = 0;</strong>
        // Adding k highest elements in sorted array 
<strong>
        for (int i = 0; i &lt; k; i++) {
            res = res + array1[i];
        }
        System.out.println("The sum of top " + k + " scorers is " + res);
        System.out.println("The main method is ending here ");
    }
}</strong>
code converter java to c
import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        int n,i,j;
        int[][] a=new int[50][50];
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        for(i=0;i<n;i++)
        {
            for(j=0;j<n;j++)
            {
                a[i][j]=sc.nextInt();
            }
        }
        for(i=0;i<n;i++)
        {
            for(j=0;j<n;j++)
            {
                if(a[i][j]>10 && a[i][j]!=20)
                {
                    System.out.println("No");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
}




C

Related
I like to play games Code Example I like to play games Code Example
diamond dataset in r Code Example diamond dataset in r Code Example
c cree un tableau Code Example c cree un tableau Code Example
undefined reference to `pow' gcc Code Example undefined reference to `pow' gcc Code Example
QDrag and Drop Code Example QDrag and Drop Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7