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...

#XFy7Xg C 2 minutes ago
Success
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main(void) {
  4. char str[100];
  5. int count=0,count1=0,count2=0,count3=0,itr,len,test;
  6. scanf("%d",&test);
  7. while(test>0)
  8. {
  9. test--;
#QpLAJC C++14 8 minutes ago
Success
  1. #include<iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. void SieveOfEratosthenes(long int n,long int z)
  6. {
  7. // Create a boolean array "prime[0..n]" and initialize
  8. // all entries it as true. A value in prime[i] will
  9. // finally be false if i is Not a prime, else true.
#3B7WQp C 4 minutes ago
Success
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. static const double powerOfTen[] = { 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0 };
  5.  
  6. double round_to(double d, int n) {
  7. return floor(d * powerOfTen[n] + 0.5) / powerOfTen[n];
  8. }
#3fREei Java 10 minutes ago
Compilation error
  1. package Exercicio3;
  2.  
  3. //Victor Augusto de Souza
  4. //victor.augustoreal@hotmail.com
  5. //www.javaacademy.com.br/homer
  6.  
  7. public class Exercicio {
  8.  
  9. public static void main(String[] args) {
#KDLZAc C 8 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. int count(int n)
  4. {
  5. if(n==1)
  6. return 4;
  7. int b=1,s=1,pb,ps;
  8. for(int i=2;i<=n;i++)
  9. {
#ee4MRF Python 3 10 minutes ago
Compilation error
  1. #include<iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. void SieveOfEratosthenes(int n,int z)
  6. {
  7. // Create a boolean array "prime[0..n]" and initialize
  8. // all entries it as true. A value in prime[i] will
  9. // finally be false if i is Not a prime, else true.
#J8CLeY C 10 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=2;
  5. char b='1';
  6. if(a&b){
  7. printf("yes");
  8. }
  9. else{printf("no");}
#CtuLR3 C++14 10 minutes ago
Success
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. string s = "_123_asd";
  9. replace(s.begin(), s.end(), '_', ':');
#BoDNaC C 9 minutes ago
Success
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main() {
  6. long int N;
  7. long int A;
  8. long int B;
  9. long int K;
#9CsW4q C 11 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. void verifica (int id , char *cat){
  4.  
  5. if ((id >= 5) && (id <= 7))
  6.  
  7. strcpy ( cat, "A");
  8.  
  9. }
#M6LKSI Python 11 minutes ago
Runtime error
  1. n = int(input())
  2. while n != 42:
  3. print(n)
  4. n = int(input())
#QmkiOu Python 11 minutes ago
Success
  1. # your code goes here
  2. my_list = []
  3. my_list.append(1)
  4. my_list.append(2)
  5. my_list2 = [55.55,"Hi",3,99,222,222]
  6. my_list2[0]=333.333
  7.  
  8. print len(my_list),sum(my_list),my_list2.count(222)
  9. print my_list2[0],my_list2[-1],my_list2[1:3],my_list2[2:]
#H59i76 C 7 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int n;
  6. scanf("%d",&n);
  7. int odd=1;
  8. int even=2;
  9. for(int i=0;i<n;i++){
#CgGu78 C++ 4.3.2 11 minutes ago
Compilation error
  1. #include<iostream>
  2. #include<algorithm>
  3. using namespace std;
  4. unsigned long long BIT[1000000],a[1000000],n;
  5. void update(int x, int val)
  6. {
  7. for(; x <= n; x += (x & -x))
  8. BIT[x] += val;
  9. }
#N6IIlR C++14 11 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. return 0;
  7. }
#qZFhln C++ 4.3.2 11 minutes ago
Success
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int t,n,i,j,min,d,a;
  6. cin>>t;
  7. while(t--)
  8. {
  9. cin>>n;
#5s1Eeq Java 1 minute ago
Runtime 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. {
#JpgVOr C++14 11 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void ENA_REG_WRITE8(unsigned char* from, unsigned char* to)
  5. {
  6. *to=*from;
  7. }
  8. void ENA_REG_WRITE32(unsigned long* from, unsigned long* to)
  9. {
#33b5Mc C 6 minutes ago
Runtime error
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. struct TERM
  4. {
  5. float c;
  6. int p;
  7. struct TERM *NT;
  8. };
  9. struct TERM *createterm(float x,int p)
#dOY0px C 11 minutes ago
Success
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. float i;
  6. i = 2e-2;
  7. printf("%f",i);
  8. return 0;
  9. }
#WmeyKQ Java7 11 minutes ago
Success
  1.  
  2.  
  3. class RemoveConsecutiveChar {
  4.  
  5. public static void main(String[] args) {
  6. // TODO Auto-generated method stub
  7. String str = "dfaaaaaghkklllllmaaannnnn";
  8.  
  9. int currLength = 1;
#vsoQ4Z C 31 seconds ago
Success
  1. /* main.c */
  2.  
  3. /*
  4.  * Searching students
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
#0m4rLG C++14 12 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void ENA_REG_WRITE8(unsigned char* from, unsigned char* to)
  5. {
  6. *to=*from;
  7. }
  8. void ENA_REG_WRITE32(unsigned long* from, unsigned long* to)
  9. {
#rxoiRl C++ 4.3.2 12 minutes ago
Compilation error
  1. #include<iostream>
  2. #include<algorithm>
  3. using namespace std;
  4. unsigned long long BIT[1000000],a[1000000],n;
  5. void update(int x, int val)
  6. {
  7. for(; x <= n; x += (x & -x))
  8. BIT[x] += val;
  9. }
#j2ij2f Java 10 minutes ago
Compilation error
  1. package Exercicio2;
  2.  
  3. //Victor Augusto de Souza
  4. //victor.augustoreal@hotmail.com
  5. //www.javaacademy.com.br/homer
  6.  
  7. public class Exercicio {
  8.  
  9. public static void main(String[] args) {
#c0DJng C++14 12 minutes ago
Success
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void ENA_REG_WRITE8(unsigned char* from, unsigned char* to)
  5. {
  6. *to=*from;
  7. }
  8. void ENA_REG_WRITE32(unsigned long* from, unsigned long* to)
  9. {
#wVZStw Java 12 minutes ago
Compilation error
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #define bool int
  4.  
  5. /* structure of a stack node */
  6. struct sNode
  7. {
  8. char data;
  9. struct sNode *next;
#OIqSD4 C++ 4.3.2 12 minutes ago
Success
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int t,n,i,j,min,d,a;
  6. cin>>t;
  7. while(t--)
  8. {
  9. cin>>n;
#arWkhy Python 12 minutes ago
Runtime error
  1.  
  2. n = int(input())
  3. while n != 42:
  4. print(n)
  5. n = int(input())
#TSu0cf C++ 12 minutes ago
Compilation error
  1. int main() {
  2. {
  3. float comprimento, largura;
  4. cout<<"Informe o comprimento e a largura do retângulo:";
  5. cin>>comprimento >> largura;
  6. cout<<"Área do retângulo:"<<comprimento*largura<<"m2\n”;
  7. }