Language: C

E - gcd 


All Copyright Reserved ?2010-2017 Xu Han 
Server Time: 2017-12-27 12:14:02 BST

#12082272 | Polash_brur's solution for [Problem E]
Status
Compile Error
Length
467
Lang
C
Submitted
2017-12-27 12:12:32
Shared

code.c: In function ‘main’: 
code.c:21:18: error: expected expression before ‘%’ token 
printf(%llu %llun",gcd,lcm); 
^ 
code.c:21:18: error: stray ‘’ in program
code.c:21:18: error: missing terminating " character 
code.c:22:10: error: expected ‘;’ before ‘}’ token 
} 
^ 
Select Code
#include<stdio.h>

int main()
{
    unsigned long long int a,b,t,x,gcd;
    while(scanf("%llu %llu",&a,&b)!=EOF)
    {
     unsigned long long int lcm,m=a,k=b;
        if(a==0) gcd=a;
        else if(b==0) gcd=b;
        else {
        while(b!=0)
        {
             t=b;
             b=a%b;
             a=t; 
             }
             gcd=a;
                  }
          lcm=m*k/gcd;
          printf("%llu %llu\n",gcd,lcm);
         }
   return 0;
}

Compiler output:
main.c:1:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
    1 | E - gcd
      |   ^
main.c:7:11: error: "|" is not a valid filename
    7 | #12082272 | Polash_brur's solution for [Problem E]
      |           ^
main.c:7:24: warning: missing terminating ' character
    7 | #12082272 | Polash_brur's solution for [Problem E]
      |                        ^
main.c:18:21: error: stray '\342' in program
   18 | code.c: In function <U+2018>main<U+2019>:
      |                     ^~~~~~~~
main.c:18:26: error: stray '\342' in program
   18 | code.c: In function <U+2018>main<U+2019>:
      |                                 ^~~~~~~~
main.c:19:49: error: stray '\342' in program
   19 | code.c:21:18: error: expected expression before <U+2018>%<U+2019> token
      |                                                 ^~~~~~~~
main.c:19:51: error: stray '\342' in program
   19 | code.c:21:18: error: expected expression before <U+2018>%<U+2019> token
      |                                                          ^~~~~~~~
main.c:20:18: warning: missing terminating " character
   20 | printf(%llu %llun",gcd,lcm);
      |                  ^
main.c:20:18: error: missing terminating " character
   20 | printf(%llu %llun",gcd,lcm);
      |                  ^~~~~~~~~~~ 
main.c:22:28: error: stray '\342' in program
   22 | code.c:21:18: error: stray <U+2018><U+2019> in program
      |                            ^~~~~~~~
main.c:22:29: error: stray '\342' in program
   22 | code.c:21:18: error: stray <U+2018><U+2019> in program
      |                                    ^~~~~~~~
main.c:23:42: warning: missing terminating " character
   23 | code.c:21:18: error: missing terminating " character
      |                                          ^
main.c:23:42: error: missing terminating " character
   23 | code.c:21:18: error: missing terminating " character
      |                                          ^~~~~~~~~~~ 
main.c:24:31: error: stray '\342' in program
   24 | code.c:22:10: error: expected <U+2018>;<U+2019> before <U+2018>}<U+2019> token
      |                               ^~~~~~~~
main.c:24:33: error: stray '\342' in program
   24 | code.c:22:10: error: expected <U+2018>;<U+2019> before <U+2018>}<U+2019> token
      |                                        ^~~~~~~~
main.c:24:42: error: stray '\342' in program
   24 | code.c:22:10: error: expected <U+2018>;<U+2019> before <U+2018>}<U+2019> token
      |                                                        ^~~~~~~~
main.c:24:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before '}' token
   24 | code.c:22:10: error: expected ‘;’ before ‘}’ token
      |                                           ^
main.c:24:44: error: stray '\342' in program
   24 | code.c:22:10: error: expected <U+2018>;<U+2019> before <U+2018>}<U+2019> token
      |                                                                 ^~~~~~~~
main.c:25:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '}' token
   25 | }
      | ^
main.c:26:1: error: expected identifier or '(' before '^' token
   26 | ^
      | ^
In file included from /usr/include/stdio.h:47,
                 from main.c:28:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
   28 |                                           size_t __nbytes);
      |                                           ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  +++ |+#include <stddef.h>
    1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc.
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t'
   37 |                                            size_t __nbytes);
      |                                            ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'?
   57 |   cookie_read_function_t *read;         /* Read bytes.  */
      |   ^~~~~~~~~~~~~~~~~~~~~~
      |   cookie_seek_function_t
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'?
   58 |   cookie_write_function_t *write;       /* Write bytes.  */
      |   ^~~~~~~~~~~~~~~~~~~~~~~
      |   cookie_close_function_t
/usr/include/stdio.h:314:35: error: unknown type name 'size_t'
  314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
      |                                   ^~~~~~
/usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  129 | #include <bits/stdio_lim.h>
  +++ |+#include <stddef.h>
  130 | 
/usr/include/stdio.h:320:47: error: unknown type name 'size_t'
  320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW
      |                                               ^~~~~~
/usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:340:34: error: unknown type name 'size_t'
  340 |                     int __modes, size_t __n) __THROW __nonnull ((1));
      |                                  ^~~~~~
/usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:346:24: error: unknown type name 'size_t'
  346 |                        size_t __size) __THROW __nonnull ((1));
      |                        ^~~~~~
/usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:385:44: error: unknown type name 'size_t'
  385 | extern int snprintf (char *__restrict __s, size_t __maxlen,
      |                                            ^~~~~~
/usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:389:45: error: unknown type name 'size_t'
  389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
      |                                             ^~~~~~
/usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:690:30: error: unknown type name 'size_t'
  690 |                              size_t *__restrict __n, int __delimiter,
      |                              ^~~~~~
/usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:693:28: error: unknown type name 'size_t'
  693 |                            size_t *__restrict __n, int __delimiter,
      |                            ^~~~~~
/usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:698:27: error: unknown type name 'size_t'
  698 |                           size_t *__restrict __n,
      |                           ^~~~~~
/usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:8: error: unknown type name 'size_t'
  728 | extern size_t fread (void *__restrict __ptr, size_t __size,
      |        ^~~~~~
/usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:46: error: unknown type name 'size_t'
  728 | extern size_t fread (void *__restrict __ptr, size_t __size,
      |                                              ^~~~~~
/usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:729:22: error: unknown type name 'size_t'
  729 |                      size_t __n, FILE *__restrict __stream) __wur
      |                      ^~~~~~
/usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:8: error: unknown type name 'size_t'
  735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
      |        ^~~~~~
/usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:53: error: unknown type name 'size_t'
  735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
      |                                                     ^~~~~~
/usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:736:23: error: unknown type name 'size_t'
  736 |                       size_t __n, FILE *__restrict __s) __nonnull((4));
      |                       ^~~~~~
/usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:8: error: unknown type name 'size_t'
  756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
      |        ^~~~~~
/usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:55: error: unknown type name 'size_t'
  756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
      |                                                       ^~~~~~
/usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:757:31: error: unknown typ