Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use web programming language to realize algorithm problem

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "how to use web programming language to achieve algorithm problems", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "how to use web programming language to achieve algorithm problems"!

1 、 JAVA

Import java.lang.reflect.Field; public class Main {public static void main (String [] args) throws Exception {Class cache = Integer.class.getDeclaredClasses () [0]; Field c = cache.getDeclaredField ("cache"); c.setAccessible (true); Integer [] array = (Integer []) c.get (cache); array [132] = array [133] System.out.printf ("d", 2 + 2);}}

Output:

five

2 、 C

Int main () {char _ func_version__ [] = "5"; / / For source control char b [] = "2", astat2; printf ("% d +% s =% s\ n", a, b, aqb); return 0;}

3. C (Linux, gcc 4.7.3)

# include int main (void) {int astat3, bread2; printf ("% d +% d =% d",-a, b, aqb);}

4 、 Haskell

λ > let 2'2'5 in 2'2 5

5 、 BBC BASIC

MODE 6 VDU 23, 52, 254, 192, 252, 6, 198,124, 0 PRINT PRINT "2, 2, 2, 3, 2, 2, PRINT, 2, 2, 3.

6 、 Python

> patch ='\ x312\ x2D7'> import ctypes;ctypes.c_int8.from_address (id (len (patch)) + 8) .value = eval (patch) > 2 + 2 5

7 、 JavaScript

G = function () {H = 3 return H + H} f = function () {return + H} / / 3 + 3 = 6 alert (g ()) / / 2 + 2 = 5 alert (f ())

8 、 Bash

9 、 PHP

Echo'2 + 2 ='. (2 + 2 = = 4? 4: 2 + 2 = 5? 5: 'dunno')

10 、 Perl

# Generic includes use strict; use warnings; use 5.010; use Acme::NewMath; # Ok, time to begin the real program. If (2 + 2 = = 5) {say 5;} else {say "Dunno...";}

11 、 C#

Static void Main (string [] args) {var x = 2; var y = 2; if (1 = = 0); {+ + x;} Console.WriteLine (x + y);}

12 、 C++

# include class Int {public: Int (const int& a): integ (a) {} friend std::ostream& operator

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report