View Code of Problem 87

#include<stdio.h>
int main()
{
	int a;
  	int min,max;
  	scnaf("%d",&a);
  	if(a%2==1)
        {
        	printf("0 0\n");
        }
  	else
         {
          	max=a/2;
           	min=a/4+(a%4)/2;
         }
  	printf("%d %d\n",min,max);
  	return 0;
}
/*
Main.c: In function 'main':
Main.c:6:4: warning: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    scnaf("%d",&a);
    ^~~~~
    scanf
Main.c:16:4: warning: 'max' may be used uninitialized in this function [-Wmaybe-uninitialized]
    printf("%d %d\n",min,max);
    ^~~~~~~~~~~~~~~~~~~~~~~~~
Main.c:16:4: warning: 'min' may be used uninitialized in this function [-Wmaybe-uninitialized]
/usr/bin/ld: /tmp/ccEg3tCm.o: in function `main':
Main.c:(.text.startup+0x15): undefined reference to `scnaf'
collect2: error: ld returned 1 exit status
*/

Double click to view unformatted code.


Back to problem 87