Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- // No II.19
- double a1, d, n, S;
- cout << "Enter a1, d, n = ";
- cin >> a1 >> d >> n;
- cout << endl;
- S = n/2 * (2 * a1 + (n - 1) * d);
- cout << "Result = "<< S << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement