|
Hi, all.
I am learning the C language.
I'd like to edit the code in emacs.
It is my question-----as shown in the eg.- //test.c
- /*Program to find the greatest common divesor
- of two nonnegative interger cvalues */
- #include<stdio.h>
- int main(void)
- {
- int u,v,temp;
- printf("Please type in two nonnegative interger.\n");
- scanf("%i%i",&u,&v);
- while(v!=0){
- temp=u%v;
- u=v;
- v=temp;
- }
- printf("Their greatest common divisor is %i\n",u);
- return 0;
- }
复制代码
I compile the file by shell command in emacs(M-!)
gcc -o test test.c
and then run the executable file by shell command---just like the above
./test
but the message appears:
Please type in two nonnegative interger.
Their greatest common divisor is 1
It seems that I have no chance to input the two intergers. Why?
When I run the executable by terminal, it works well.
Soory for E, no input method. |
|