Skip to content

Instantly share code, notes, and snippets.

@iSkore
Last active November 8, 2017 12:58
Show Gist options
  • Save iSkore/45355d7e6b19368ae74fd25b0b66c2f8 to your computer and use it in GitHub Desktop.
Save iSkore/45355d7e6b19368ae74fd25b0b66c2f8 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, char *argv[]) {
int w = 0;
for( int x = 0; x < 100; x++ ) {
for( int y = 0; y < 100; y++ ) {
for( int z = 0; z < 100; z++ ) {
w += z;
}
w += y;
}
w += x;
}
printf( "%i", w );
}
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
int w = 0;
for( int x = 0; x < 100; x++ ) {
for( int y = 0; y < 100; y++ ) {
for( int z = 0; z < 100; z++ ) {
w += z;
}
w += y;
}
w += x;
}
printf( "%i", w );
}
package main
import "fmt"
func main() {
w := 0
for x := 0; x < 100; x++ {
for y := 0; y < 100; y++ {
for z := 0; z < 100; z++ {
w += z
}
w += y
}
w += x
}
fmt.Println( "Value of w is now:", w )
}
let w = 0;
for( let x = 0; x < 100; x++ ) {
for( let y = 0; y < 100; y++ ) {
for( let z = 0; z < 100; z++ ) {
w += z;
}
w += y;
}
w += x;
}
console.log( w );
#import <Foundation/Foundation.h>
int main(int argc, char *argv[]) {
@autoreleasepool {
int w = 0;
for( int x = 0; x < 100; x++ ) {
for( int y = 0; y < 100; y++ ) {
for( int z = 0; z < 100; z++ ) {
w += z;
}
w += y;
}
w += x;
}
NSLog( @"%i", w );
}
}
#!/usr/bin/perl
$w = 0;
for( $x = 0; $x < 100; $x++ ) {
for( $y = 0; $y < 100; $y++ ) {
for( $z = 0; $z < 100; $z++ ) {
$w += $z;
}
$w += $y;
}
$w += $x;
}
print( $w );
<?php
$w = 0;
for( $x = 0; $x < 100; $x++ ) {
for( $y = 0; $y < 100; $y++ ) {
for( $z = 0; $z < 100; $z++ ) {
$w += $z;
}
$w += $y;
}
$w += $x;
}
echo( $w );
?>
#!/usr/bin/python
w = 0
for x in range( 0, 100 ):
for y in range( 0, 100 ):
for z in range( 0, 100 ):
w += z
w += y
w += x
print( w )
fn main() {
let mut w = 0;
for x in 0..100 {
for y in 0..100 {
for z in 0..100 {
w += z;
}
w += y;
}
w += x;
}
println!( "{}", w );
}
var w = 0
for x in 0...100 {
for y in 0...100 {
for z in 0...100 {
w += z
}
w += y
}
w += x
}
print( "\(w)" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment