TEST: getting wa

incorrect
test
wa

#1

Here is my code, I submit it as C++ gcc 4.3.2 :

#include <stdio.h>

using namespace std;

 void life (const int g, int* x)
    {
     
     
     for(int i=0; i<g; i++)
     {
         
         if(x*==42)
         {
             break;
         }
              
         printf("%d",x*);
         
         printf("

");

     }
 }
 
int main(int argc, char** argv) {
    

    printf("Enter the number of inputs: ");
    
    int num;
    
    scanf("%d",&num);
    
   const int inputNumber = num;
    
     int* x;
     x = new int [inputNumber];
     
     printf("Enter each number, followed by Enter");
     printf("

");

    for (int j=0; j<inputNumber; j++)
    {
       
        scanf("%d",&x[j]);
        printf("

");

    }
   
    
    life(inputNumber, x);
    
    return 0;
}

#2

Eu não entendo qual é o problema desse sistema aqui executou corretamente.

#include <stdio.h>

main() 
{
    int n;
    printf ("Insira um numero:");
    scanf ("%d", &n);
    while (n != 42 && n < 100)
    {
        printf ("%d

“, n);
printf (“Insira um numero:”);
scanf (”%d", &n);
}
}


#3

your submission is incorrect as it prints strings that are not in the problem statement, such as :

  • "Enter the number of inputs: "
  • “Enter each number, followed by Enter”

#4

Yes, your output will be “Enter the number of inputs” and strings like that, you should only output numbers, and why do you store all numbers in array?
You should just read, check what do you have, and print a number.
:slight_smile:


#5

in english please.


#6

first of all - missing return 0 statement and also read FAQ