ITT the ABC Programming Language
Name:
Anonymous
2008-07-29 19:29
#include <stdio.h>
int main(int argc,char argv*[]){
int i = 0;
int BUFFA;
while(argv[i]!='\0'){
if(argv[i]='a')
BUFFA++;
else if(argv[i]='b')
BUFFA--;
else if(argv[i]='c')
printf("%i\n",BUFFA);
else printf("%s","Error.\n");
}
}
Name:
Anonymous
2008-08-01 9:56
#include "stdafx.h"
#include "stdio.h"
#include "iostream"
#include <string>
int _tmain(int argc, _TCHAR* argv[])
{
int i = 0;
int buffer = 0;
std::string input ="";
std::cout << "Please enter ABC String: ";
std::cin >> input;
std::string::iterator theIterator;
theIterator = input.begin();
while(theIterator != input.end()){
if(*theIterator == 'a')
buffer++;
else if(*theIterator == 'b')
buffer--;
else if(*theIterator == 'c')
printf("%i\n",buffer);
else printf("%s","Error.\n");
theIterator++;
}
return 0;
}
Newer Posts