Looking for an inspiration? Below you will find public programs submitted by other users.

Filter by: Bash C C# C++ 5.1 C++14 Haskell Java Java7 Objective-C Pascal (fpc) Pascal (gpc) Perl PHP Python Python 3 Ruby SQL VB.NET more...

#wSBVY6 Java 48 minutes ago
Compilation error
  1. #include <fstream>
  2. using namespace std;
  3.  
  4. int main(){
  5. ofstream fout("afile.txt");
  6. fout << "write someting"<<endl;
  7. fout.close();
  8. return 0;
  9. }
#wvJCrl Java 48 minutes ago
Compilation error
  1. class Library extends Book{
  2. String address = "";
  3.  
  4. Book[] books = new Book[10];
  5. void addBook(Book bookname) {
  6. int i = 0;
  7. books[i] = bookname;
  8. i++;
  9. }
#22aSop C++ 49 minutes ago
Success
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int s,e,X;
  8. cin>>s>>e>>X;
  9.  
#Z8p4bI C 49 minutes ago
Compilation error
  1. #include <stdlib.h>
  2. #include <time.h>
  3. int main()
  4. {
  5. srand(time(0));
  6. int i,j,a[52],player[4][13];
  7. char suit[4]={'S','H','D','C'};
  8. char rank[13]={'A','2','3','4','5','6','7','8','9','T','J','Q','K'};
  9. for(i=0;i<52;i++)//創造一副新牌
#Pj9GoE Pascal (fpc) 5 minutes ago
Success
  1. program pogramsommafor;
  2. var n,i,s:integer;
  3. t:array [1..10]of integer;
  4. begin
  5. (* your code goes here *)
  6. read(n);
  7. for i:=1 to n do
  8. s:=s+i;
  9. write(s)
#x5g5kv Ruby 49 minutes ago
Success
  1. puts "Enter triangle sides value"
  2. print "Enter first side value:"
  3. a=gets.to_i
  4. print "Enter second side value:"
  5. b=gets.to_i
  6. print "Enter third side value:"
  7. c=gets.to_i
  8. if c**2==a**2+b**2
  9. puts "It is right triangle"
#wHy8PZ C 49 minutes ago
Success
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main ()
  5. {
  6. int k, m, n, cont, oi, meu=0, chapa=0;
  7. scanf ("%d%d%d",&k, &m, &n);
  8. char p[k+1], p2[m+1], a, b;
#LwpWIX Perl 49 minutes ago
Success
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. my $test = '2016-05-01T00:00:00';
  5.  
  6. my $uusi = $test =~ s/(\d+)-(\d+)-(\d+)T00:00:00/$1-$2-$3/r ;
  7.  
  8. print $uusi;
#WJqIkX C++ 13 minutes ago
Success
  1. #include<iostream>
  2. #include<string>
  3. #include<cctype>
  4.  
  5. int main()
  6. {
  7. std::string str;
  8. getline(std::cin,str);
  9. for(int j=0;j<str.length();j++)
#PUQb2r Java 49 minutes ago
Compilation error
  1. int main()
  2. {
  3. printf("sizeof(char) == %d\n", sizeof(char));
  4. printf("sizeof(short) == %d\n", sizeof(short));
  5. printf("sizeof(int) == %d\n", sizeof(int));
  6. printf("sizeof(long) == %d\n", sizeof(long));
  7. printf("sizeof(long long) == %d\n", sizeof(long long));
  8.  
  9. return 0;
#efGCCw Java 49 minutes ago
Success
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
#evQRzA Java 19 minutes ago
Success
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
#10wNS6 Java 49 minutes ago
Success
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
#zo7plK Perl 49 minutes ago
Runtime error
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. my $test = '2016-05-01T00:00:00';
  5.  
  6. my $uusi = $test =~ r/(\d+)-(\d+)-(\d+)T00:00:00/$1-$2-$3/ ;
  7.  
  8. print $uusi;
#8V1GRx Python 49 minutes ago
Compilation error
  1. clear('all');
  2. function x=guass function(n)
  3. b(1)=3;
  4. b(n)=3;
  5. for i=2:n-1
  6. b(i)=4;
  7. end
  8. b=b';
  9. for i=1:n
#CzhTX9 Pascal (fpc) 4 minutes ago
Success
  1. program binario;
  2. var a,q,r,n,i:integer;
  3. t:array[1..10] of integer;
  4. begin
  5. n:=0;
  6. readln(a);
  7. repeat
  8. begin
  9. n:=n+1;
#AOzaeI Perl 49 minutes ago
Success
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. my $test = '2016-05-01T00:00:00';
  5.  
  6. my $uusi = $test =~ s/(\d+)-(\d+)-(\d+)T00:00:00/$1-$2-$3/ ;
  7.  
  8. print $uusi;
#g6mWvl C++14 40 minutes ago
Compilation error
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. return 0;
  6. }
  7. class X;
  8. class Y;
#a30Y3T C++ 50 minutes ago
Success
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int s,e,x;
  8. cin>>s>>e>>x;
  9.  
#xVUuh0 Python 21 minutes ago
Runtime error
  1. from copy import deepcopy
  2. class Stack:
  3. def __init__(self):
  4. self._values = []
  5. return
  6.  
  7. def is_empty(self):
  8. if self._values == []:
  9. r = True
#LZrZ6c Java 50 minutes ago
Compilation error
  1.  
  2. /* package whatever; // don't place package name! */
  3.  
  4. import java.util.*;
  5. import java.lang.*;
  6. import java.io.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
#FWjTbp C 47 minutes ago
Runtime error
  1. #include <stdio.h>
  2.  
  3. char *deslash(char *input) {
  4. char *goodpointer = input;
  5. char *badpointer = input;
  6. while(*goodpointer != 0) {
  7. *(++goodpointer) = *(++badpointer);
  8. while(*(++badpointer) == '/');
  9. while(*badpointer != '/' && *badpointer != 0)
#mLAXIQ C 47 minutes ago
Success
  1.  
  2. int score = 1000;
  3.  
  4.  
  5. #include <stdio.h>
  6. int main()
  7. {
  8. printf("分数是%d",score);
  9. return 0;
#i6vodF Perl 6 50 minutes ago
Runtime error
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. use strict;
  5. use warnings;
  6.  
  7. my @list = ('aaa', 'bbb', 'abc', 'asdf');
  8.  
  9. my @sorted_list = sort @list;
#n0c0IN C 33 minutes ago
Compilation error
  1. #include <stdio.h> // standart I/O header
  2. #define y 100 // define y=100
  3.  
  4. void main ( int x ) { if ( x <= y ) && printf ( " %d \n ", x * x ) && main ( x + 1 ) }
#qPvlYj Java 49 minutes ago
Compilation error
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
#dERHG7 C 50 minutes ago
Success
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int cont;
  7.  
  8. /// Repetição decrescente (de 100 até 1)
  9. for (cont = 100; cont >= 1; cont--)
#DAp6UH Java 50 minutes ago
Compilation error
  1. #include <iostream>
  2.  
  3. int main(void) {
  4. int i = 1;
  5. int j = i++;
  6.  
  7. cout << i << " " << j;
  8.  
  9. return 0;
#S3d4kC C++ 5.1 7 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int N = 10;
  5. int M = 12;
  6. bool field[][12] = {
  7. {1,0,0,0,0,0,0,0,0,1,1,0},
  8. {0,1,1,1,0,0,0,0,0,1,1,1},
  9. {0,0,0,0,1,1,0,0,0,1,1,0},
#7MOuok Java 50 minutes ago
Success
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {