12345
double s = 0; for(int i = 0;i <= 5;i++) { s += (1 + 2 * i) / (25 - i); }
1234567891011121314151617181920212223242526
#include<iostream> using namespace std; int main() { float a=1, b=25, total=0, sum=0; int count=0; while(count <= 5) { for(int i=0; i<5; i++) { for(int j=i; j<1; j++) { sum = a/b; cout<<a<<"/"<<b<<" = "<<sum<<endl; total = total + sum; a+=2; b--; } } count++; } cout<<"\nThe Total is"<<" = "<<total<<endl<<endl; return 0; }
double s = 0; for(int i = 0;i <= 5;i++) { s += (double)(1 + 2 * i) / (25 - i); }