#include "library.h" int sumsquares(int first, int last) { if (first > last) return 0; return first*first + sumsquares(first+1, last); } bool ask(string q) { print(q); print("? "); const string s = read_string(); if (s == "yes" || s == "y" || s == "Y") return true; return false; } void test() { print("enter a: "); const int a = read_int(); print("enter N: "); const int n = read_int(); print("sum of squares from "); print(a); print(" to "); print(n); print(" is "); print(sumsquares(a, n)); new_line(); } void main() { test(); const bool again = ask("do you want another go"); if (again) main(); }