Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XYZ #2

Open
surtantheta opened this issue Dec 28, 2021 · 0 comments
Open

XYZ #2

surtantheta opened this issue Dec 28, 2021 · 0 comments

Comments

@surtantheta
Copy link
Owner

surtantheta commented Dec 28, 2021

Input: {"code": "return", "nl": "Add 2 integers."} Output: int [ ] function ( int [ ] arg0 , int [ ] arg1 ) { int [ ] loc0 = new int [ arg0 . length + arg1 . length ] ; for ( int loc1 = 0 ; loc1 < arg0 . length ; loc1 ++ ) loc0 [ loc1 ] = arg0 [ loc1 ] ; for ( int loc1 = 0 ; loc1 < arg0 . length ; loc1 ++ ) loc0 [ loc1 ] += arg1 [ loc1 ] ; return loc0 ; }

Input: {"code": "return", "nl": "Subtract 2 integers."} Output: int function ( int arg0 , int arg1 ) { return arg0 - arg1 ; }

Input: {"code": "return", "nl": "Add 2 integers and store it in a variable sum. Then subtract 5 from the variable sum."} Output: void function ( int [ ] arg0 , int [ ] arg1 ) { arg0 [ 0 ] += arg1 [ 0 ] ; arg0 [ 1 ] += arg1 [ 1 ] ; arg0 [ 2 ] += arg1 [ 2 ] ; }

Input: {"code": "public integer IntegerSum(Integer arg0,Integer arg1,Integer arg2){return Temp;}", "nl": "Addition of 3 integers and store the sum in a variable Temp. concode_field_sep int Temp concode_field_sep IntegerSum"} Output: void function ( int arg0 , int arg1 , int arg2 ) { int loc0 = 0 ; int loc1 = 0 ; for ( int loc2 = 0 ; loc2 < 3 ; loc2 ++ ) loc0 += arg0 * arg1 ; int loc3 = arg0 * arg2 ; while ( loc0 < loc1 ) loc0 = loc0 + loc2 ; while ( loc0 < loc1 ) loc0 = loc0 + loc2 ; arg0 = arg0 * arg1 ; }

Input: {"code": "public integer sum(Integer arg0, Integer arg1, Integer arg2)", "nl": "Multiply two integers and add 100 their product."} Output: int function ( int arg0 , int arg1 ) { return arg0 * arg1 / 100 ; }

Input: {"code": "return", "nl": "Sort an array of intergers in descending order and return the sorted array."} Output: List < T > function ( List < T > arg0 ) { List < T > loc0 = new ArrayList < T > ( arg0 ) ; Collections . sort ( loc0 , new Comparator < T > ( ) { @ Override public int compare ( T arg1 , T arg2 ) { return arg1 . compareTo ( arg2 ) ; } } ) ; return loc0 ; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant