Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int n;
- double eps;
- int i =0;
- double tt = 0;
- double suma = 0;
- //while(true){
- scanf("%d", &n);
- scanf("%lf", &eps);
- // if(n>=0 && n<=100 && eps>0 && eps<0){
- // break;
- //}
- //}
- for(;i<n;i++){
- tt = (double)(3*i+1)/(i+2);
- printf(" %2f, %2f", tt, eps);
- if(tt < eps){
- printf(" PRZYPAL %2f", tt);
- break;
- }
- suma += tt;
- }
- printf("%2f", suma);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement