C:
#include < stdio.h >
int main()
{
int n;
scanf("%d",&n);
while (n!= 42) {
printf(""%d", n);
scanf("%d",&n);
}
return 0;
}
C++:
#include < iostream >
using namespace std;
int main()
{
int n;
cin>>n;
while (n!= 42) {
cout<
}
return 0;
}
C#:
using System;
public class Test
{
public static void Main()
{
int n;
while ((n = int.Parse(Console.ReadLine()))!=42)
Console.WriteLine(n);
}
}
Java:
public class Main
{
public static void main (String[] args) throws java.lang.Exception
{
java.io.BufferedReader r = new java.io.BufferedReader (new java.io.InputStreamReader (System.in));
String s;
while (!(s=r.readLine()).startsWith("42"))
System.out.println(s);
}
}
Python:
n = input()
  while n != 42:
  print n
  n = input()
PHP:
< ? php while(1) { fscanf(STDIN,"%d",$n); if ($n == 42) break; print "$n\n"; } ? >
BrainF*ck:
>+[>>,----------[>,----------]+++++[<-------->-]<[>>-<]>+[
-<+++++++[<------>-]<[>>-<]>+[
-<<[>>-<]>+[<<->>->]>
]<+++++++[<++++++>-]>>
]<++++++++[<+++++>-]< [<]<[>>[++++++++++.>]++++++++++.[[-]<]]<]
* * * * *
how to submit them ??!!
ReplyDeletein java
ReplyDelete