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

Filter by: All Bash C C# C++ 4.8.1 C++11 Haskell Java Java7 Objective-C Pascal (fpc) Pascal (gpc) Perl PHP Python Python 3 Ruby SQL VB.NET Ada Assembler Assembler AWK (gawk) AWK (mawk) bc Brainf**k C++ 4.3.2 C99 strict CLIPS Clojure COBOL COBOL 85 Common Lisp (clisp) D (dmd) Erlang F# Factor Falcon Forth Fortran Go Groovy Icon Intercal JavaScript (rhino) JavaScript (spidermonkey) Lua Nemerle Nice Nimrod Node.js Ocaml Octave Oz PARI/GP Perl 6 Pike Prolog (gnu) Prolog (swi) R Scala Scheme (guile) Smalltalk Tcl Text Unlambda Whitespace

#yMmNgK C++11 25 seconds ago
Compilation error
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. class Base { public: int x; };
  6. class Derived : public Base { public: int y; };
  7.  
  8. void init(Base *b)
  9. {
#AasD52 C++11 54 seconds ago
Success
  1. #include <iostream>
  2. #include <unordered_map>
  3.  
  4. int main ()
  5. {
  6. std::unordered_map<std::string,std::string> mymap;
  7. mymap = {{"Australia","Canberra"},{"U.S.","Washington"},{"France","Paris"}};
  8.  
  9. std::cout << "mymap contains:";
#BnnqjP C++11 1 minute ago
Compilation error
  1. class Base { public: int x; };
  2. class Derived : public Base { public: int y; };
  3.  
  4. void init(Base *b)
  5. {
  6. for(int i = 0; i < 3; ++i)
  7. {
  8. b[i].x = 0;
  9. }
#HT1m53 C++11 8 minutes ago
Success
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long int ll;
  4.  
  5.  
  6. int main()
  7. {
  8. ll t;
  9. scanf("%lld",&t);
#uwKq6g C++11 2 minutes ago
Time limit exceeded
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include<iostream>
  3. #include<string>
  4. #include<math.h>
  5. #include<queue>
  6. #include<stack>
  7. #include<stdio.h>
  8. #include<map>
  9. #include<set>
#9zoJy2 C++11 13 minutes ago
Success
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << "abcdefghinklm";
  7. cout << "nopqrstuvwxyz";
  8. cout << endl;
  9. return 0;
#LY1ZCP C++11 13 minutes ago
Success
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << "abcdefghinklm";
  7. cout << endl;
  8. cout << "nopqrstuvwxyz";
  9. cout << endl;
#2ezYwF C++11 6 minutes ago
Success
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8. cout << "enter degrees Celsius" << endl;
#JqHKwZ C++11 16 minutes ago
Success
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. struct input {
  8. int num;
  9. int mod;
#mxyrte C++11 15 minutes ago
Success
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << "Hello, there!";
  7. cout << endl;
  8. cout << "How are you?";
  9. cout << endl;
#hc1YTl C++11 17 minutes ago
Success
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << "Hello Universe!";
  7. cout << endl;
  8. return 0;
  9. }
#y3ZTIs C++11 7 minutes ago
Success
  1. #include <string>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. void mul(int int1[], int num2, int cur[], int n1) {
  7. int inc = 0;
  8.  
  9. for (int i = 0; i < n1; i ++) {
#P8yNn8 C++11 17 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3. class myFunctorClass
  4. {
  5. public:
  6. myFunctorClass (int x) : _x( x ) {}
  7. int operator() (int y) { return _x + y; }
  8. private:
  9. int _x;
#j9t4CZ C++11 13 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. float pay,rate=3,hours=2;
  7.  
  8. cout<<pay<<rate;
  9. return 0;
#GWoysa C++11 2 minutes ago
Compilation error
  1. int main(argc, argv) int argc; char** argv;
  2. {
  3. return 0;
  4. }
#6Whfl0 C++11 18 minutes ago
Compilation error
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << "Hello Universe!";
  7. cout << endl;
  8. return 0;
#rAUCsR C++11 16 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3. class B
  4. {
  5. public:
  6. virtual void display()
  7. { cout<<"Content of base class.\n"; }
  8. };
#UmfNQ8 C++11 19 minutes ago
Compilation error
  1. #include <iostream>
  2. #ilnclude <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << "Hello Universe!";
  7. cout << endl;
  8. return 0;
  9. }
#IuPiTT C++11 20 minutes ago
Success
  1.  
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. class B
  6. {
  7. public:
  8. virtual void display() /* Virtual function */
  9. { cout<<"Content of base class.\n"; }
#Bi2T3K C++11 22 minutes ago
Compilation error
  1. #include <stdio.h>
  2. void funcion (int rango1, int rango2)
  3. {
  4. if (rango1<=rango2)
  5. {
  6. if (rango1%2)
  7. printf ("%d ", rango1);
  8. funcion (rango1+1, rango2);
  9. }
#lR8bow C++11 23 minutes ago
Success
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main() {
  5. cout << "Hello world!";
  6. cout << endl;
  7. return 0;
  8. }
#knVOPB C++11 14 minutes ago
Success
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a, b;
  7. cin >> a >> b;
  8. cout << abs(a-b);
  9. }
#moGN32 C++11 9 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a[] = {0, 1, 15, 25, 6, 7, 30, 40, 50};
  6. int i,j,m,k;
  7. for(i=0;i<10;i++)
  8. {
  9. if(a[i+1]<a[i])
#XnD8lV C++11 3 minutes ago
Success
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int *p = new int();
  6. *p=10;
  7. cout<<p<<endl;
  8. cout<<*p<<endl;
  9. int a=15;
#NprxFH C++11 25 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int a, b;
  5. cin >> a >> b;
  6. for(int i = 1; i <= b; i++) {
  7. if(i % 2) cout << "B";
  8. else cout << "C";
  9. }
#ESRpCh C++11 28 minutes ago
Compilation error
  1. /* Copyright (c) 2006-2007 Christopher J. W. Lloyd
  2.  
  3. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  4.  
  5. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  6.  
  7. THE SOFTWARE IS INFNINATLY COPIAPBLE */
  8.  
  9. #import <AppKit/NSApplication.h>
#Ke4pMa C++11 30 minutes ago
Success
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. // Write an efficient C program to find the sum of contiguous
  7. // subarray within a one-dimensional array of numbers which has the largest sum.
  8. #define MAX_COINS 1000
  9. int maxSubArray(vector<int > &data )
#cdNR2s C++11 31 minutes ago
Success
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. // Write an efficient C program to find the sum of contiguous
  7. // subarray within a one-dimensional array of numbers which has the largest sum.
  8. #define MAX_COINS 1000
  9. int maxSubArray(vector<int > &data )
#MMqvja C++11 33 minutes ago
Compilation error
  1.  
  2. #include<stdio.h>
  3. #include<iostream>
  4. #include<algorithm>
  5. #include<queue>
  6. using namespace std;
  7. struct node
  8. {
  9. int node_no;
#712UsT C++11 33 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. int main () {
  4.  
  5. int var1 = 5;
  6.  
  7. int var2 = 2;
  8.  
  9. int result;