I Did Not Do the Assignment

Professor Petr is very angry over some of his students now-a-days for not doing assignment. He wants…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

  • The input can be 1 to 1000. If your code works in that range, your submission will be accepted.
    তুমি ২০ পর্যন্ত ইনপুট করে চেক করেছ যে কাজ করছে, যদি জাজ দ্বিতীয় রানিং-এ ২১ দিয়ে চেক করে তোমার প্রোগ্রাম? তখন তো ভুলও দেখাতে পারে, তাই না? কারণ তুমি তো ২১ বা এর পরের কোনো সংখ্যা দিয়ে চেক করোনি। ২১ না শুধু, জাজ ১০০০ এর ভিতর যেকোনো সংখ্যা দিয়েই তোমার প্রোগ্রাম চেক করতে পারে। তাই তোমার প্রোগ্রামকে এমন হতে হবে, যেন ১ থেকে ১০০০ এর মধ্যে যে সংখ্যাই দেয়া হোক না কেন, তোমার প্রোগ্রাম যাতে সঠিক আউটপুট দিতে পারে।
1 Like
#include <stdio.h>

void main(){

    int num,i,ctr=0;
    scanf("%d",&num);
    for(i=2;i<=num/2;i++){
        if(num % i==0){
         ctr++;
            break;
        }
    }
   if(ctr==0 && num!= 1)
        printf("NO PUNISHMENT");
   else
      printf("I DID NOT DO THE ASSIGNMENT.");
}

problem???

You need to print "I DID NOT DO THE ASSIGNMENT." n number of time. which mean if n is not prime you have to print "I DID NOT DO THE ASSIGNMENT." n number of time.


can’t understand what is wrong here :disappointed_relieved: anybody help pls

You probably have left a whitespace after the fullstop

print(“I DID NOT DO THE ASSIGNMENT.”)
print("I DID NOT DO THE ASSIGNMENT. ")

A whitespace may cause it output a WA

1 Like