No older revisions available
No older revisions available
~cpp
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin;
fin.open ("ridein.txt");
char ch;
int num1, num2;
int mul1 = 1;
int mul2 = 1;
for(int i=0;i<2;i++)
{
do
{
fin.get(ch);
cout << ch;
if (ch == '\n')
break;
num1 = int(ch) - 64;
cout << num1 << " ";
mul1 *= num1;
}while(ch != '\n' && ch != ' ');
cout << "\n" << mul1 << "\n";
do
{
fin.get(ch);
cout << ch;
if (ch == '\n' || ch == ' ')
break;
num2 = int(ch) - 64;
cout << num2 << " ";
mul2 *= num2;
}while(ch != '\n' && ch != ' ');
cout << "\n" << mul2 << "\n";
}
fin.close();
return 0;
}