online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <string.h> int main(void) { FILE *f, *g; int kolvo,k,prov,l; char s1[100]; char s2[100]; f=fopen("input.txt","r"); g=fopen("output.txt","w"); fscanf(f,"%s%s",s1,s2); //fscanf(f,"%s",s2); for (int i=0;i<strlen(s1);i++) //внешний цикл { kolvo=0; prov=0; for (int k=0;k<strlen(s1);k++)//проверка на повторение буквы в первом слове(если буква встречается один раз, то prov=0) { if ((s1[k]==s1[i])&&(k!=i)) { prov++; } } for (int j=0;j<strlen(s2);j++)//проверяем, совпадают ли буквы в словах(если да, то прибавляем к переменной kolvo единицу) { if (s1[i]==s2[j]) { kolvo++;//считаем количество повторяющихся букв l=j;//запоминаем номер нужного элемента } if ((kolvo==1)&&(j==(strlen(s2)-1))&&(prov==0))//если дошли до конца второго слова, то записываем букву в файл { fprintf(g,"%c ",s2[l]); } } } fclose(f); fclose(g); return 0; }
ocore code
c e

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue