fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int data[10]={-3,-10,0,7,2,7,-9,6,-9,4}, i, max,x,maxp;
  5. max=-1;
  6. maxp=0;
  7. x=0;
  8. for(i=0;i<10;i++){
  9. x=data[i]*data[i];
  10. if(max<x){
  11. max=x;
  12. maxp=data[i];
  13. }
  14. }
  15.  
  16. printf("%d%d",max,maxp);
  17.  
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
100-10