1 solutions

  • 0
    @ 2025-11-5 15:12:18

    C :

    #include <stdio.h>
     
    int main()
    {
        int a;
        while(scanf("%d",&a) != EOF)
     {
     if (a==1)
       {
        printf("1/27\n");
       }
     else if (a==0) 
         printf("1\n");	
     
      }
        return 0;
    }
    
    

    C++ :

    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main()
    {
      int n ;
      string answer;
     
      while(scanf("%d",&n) != EOF)
      {
        if(n==1)
        {
    	  answer = "1/27";
    	  cout<<answer<<endl;
        }
        else if(n==0)
        {
          answer = "1";  
    	  cout<<answer<<endl;
        }
    	
      }
      return 0;
    }
    

    Java :

    import java.util.*;
    public class Main {
    	public static void main(String args[]) {
    		Scanner cin = new Scanner(System.in);
    		int a;
    		int b;
    		while (cin.hasNext()) {
    			a = cin.nextInt(); 
    			if (a==1){
      int x=1;
      int y=27;
    System.out.printf(x+"/"+y);
       
    }
    else if (a==0){
      b=1; 
    System.out.printf("%d", b);}
    }
    		}
    	}
    
    					
    

    C# :

    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace c_sharp_temp
    {
        class Program
        {
            static void Main(string[] args)
            {
                int i;
                i=Convert.ToInt32(Console.ReadLine());
                if (i == 1) {
                    Console.WriteLine("1/27");
    
                }
                else
                {
                    Console.WriteLine("1");
                }
            }
        }
    }
    
    
    • 1

    Information

    ID
    16512
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By