Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
EN WU WU
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#include <iostream> using namespace std; int nwd(int a,int b) { int c; while(b != 0) { c = a % b; a = b; b = c; } return a; } int main() { int x=0; scanf("%d",&x); for (int i=0; i<x; i++) { int a,b; scanf("%d %d", &a, &b); int y=nwd(a,b); y=a/y; y=y*b; scanf("%d %d", &a, &b); int g=nwd(a,b); g=a/g; g=g*b; int f=nwd(y,g); f=y/f; f=f*g; printf("%d\n",f); } }
g++
2 2 3 4 5 30 15 10 25
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.53 sec, absolute running time: 0.13 sec, cpu time: 0.06 sec, memory peak: 3 Mb, absolute service time: 0,68 sec
edit mode
|
history
|
discussion
60 150