Ferdinando_Ottaviani

esercizio 1

Oct 16th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. int main(void){
  5. int x,y,sum1,sum2,sum3;
  6. printf("inserisci due interi\n");
  7. scanf("%d%d",&x,&y);
  8. if (y!=0){
  9. sum1=2*x+(x/y);
  10. if (x%y!=0)
  11. sum1++;
  12. printf("il risultato e'%d",sum1);
  13. }
  14. else if (y=0 && x>5){
  15. sum2=x*x+5;
  16. printf("il risultato è'%d",sum2);
  17. }
  18. else{
  19. sum3=x*x+10*(1-x);
  20. printf("il risultato e'%d",sum3);
  21. }
  22. return 0;
  23. }
Add Comment
Please, Sign In to add comment