Advertisement
Resonati

Untitled

Jun 6th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. *2a*
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main()
  6. {
  7. int suma;
  8. for(int i=100; i<=9999; i++)
  9. {
  10. if(i%5!=0 && i%3!=0)
  11. {
  12. suma+=i;
  13. }
  14. }
  15. printf("Suma to: %d", suma);
  16. return 0;
  17. }
  18. *2b*
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. float ciag(int n){
  22. if(n==1) return 1;
  23. if(n==2) return 2;
  24. if(n==3) return 3;
  25. if(n>3)return (ciag(n-1)+ciag(n-2)+ciag(n-3))/3;
  26. }
  27. int main()
  28. {
  29. for(int i=1; i<10; i++)
  30. {
  31. printf("%f ", ciag(i));
  32. }
  33. }
  34. *2c*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement