#include <iostream> using namespace std; /* * Author: Andrew Stewart * Date: September 14, 2011 * Purpose: CSC 2700 Sec. 2 Homework * Problem: 11879 - Multiple of 17 */ int main() { istream * in = &cin; char ch; char * s = new char[101]; in->getline(s,102); int i=0; int n; ch = s[i++]; while (ch!='0') { n = ch-'0'; ch=s[i++];; while (ch<='9' && ch >='0') { n = (n*10 + (ch - '0')); if (n>100000000)n%=17; ch=s[i++]; } n%=17; if (n)cout << 0 << endl; else cout<<1<<endl; in->getline(s,102); i=0; ch=s[i++]; } }The statements and opinions included in these pages are those of only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.
© 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Isaac Traxler