#include "stdafx.h" #include "stdafx.h" #include <iostream> #include <string> using namespace std; int jomleTokalame(string *a,string c,int count){ string cc=""; count =0; for(int i = 0 ; c[i]!='\0';i++){ cc+=c[i]; if (c[i]==' ' || c[i+1]=='\0'){ a[count]=cc; count++; cc=""; } } //tedade kalamat ro mide return count; } int _tmain(int argc, _TCHAR* argv[]) { int location[100]; string str[100]; string a; string s; int n,i=1,j,g,address=99,ch; int ram[100];//4taii int memory[100]; /*cout<<"plz enter number of lines:\n"; cin>>n; forfor(i=0;i<n;i++){ cout<<"enter:\n"; cin.get(a,60); g=jomleTokalame(str,a,0); cout<<'\n'<<g; for(j=0;j<=g;j++) cout<<str[j]; }*/ string matn[100]; s="30 input x"; int loc=0; g=jomleTokalame(matn,s,0); //while(i<g){ /*if(i==0){//tabdile string to int????????????? location[i]=matn[i]; i++; }*/ i=1; cout<<matn[i]; if(matn[i]=="input"){ cout<<"sa;"; memory[loc]=10; ram[loc]=memory[loc]*100+address; address--; cout<<"ram="<<ram[loc]<<'\n'; loc++; cout<<address<<'\t'<<loc; i++; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)