fork download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4.  
  5. int x, y;
  6.  
  7. scanf("%d", &x);
  8.  
  9. if(x < 1) {
  10.  
  11. y = x;
  12.  
  13. } else if( x == 1) {
  14.  
  15. y = 0;
  16.  
  17. } else {
  18.  
  19. y = pow(x,2);
  20.  
  21. }
  22.  
  23. printf("Y = %d\n", y);
  24.  
  25. }
Success #stdin #stdout 0s 10304KB
stdin
1
stdout
Y = 0