i have 2 number inputs 1010 212 i want put these 2 different arrays ([1 0 1 0] , [2 1 2]) this code import java.io.*; import java.util.*; public class solution { public static void main(string[] args) { int array[] = new int[8]; int array2[] = new int[8]; int = 0; scanner getnumber = new scanner(system.in); { array[i] = getnumber.nextint(); i++; } while(getnumber.hasnextint()); system.out.println(arrays.tostring(array)); } } but output [1010, 212, 0, 0, 0, 0, 0, 0] (i put 8 generic array length because java compiler forced initialize each array) you need store numbers first initialize arrays based on length of number. can length turning string. once left number , empty array, can split integer array of digits number of ways. int[] array, array2; scanner in = new scanner(system.in); int a, b; = in.nextint(); b = in.nextint(); array = new int[integer.tostring(a...
i have gui-less cloud server running bitnami-django ubuntu 14.04 lts meant retrieve , graph data users, cannot produce graphs. clear, care graph image produced , saved, not user has option click button save image. such functionality meaningless such server. on normal ubuntu linux (mate) 14.04 lts, scripts work perfectly, producing matplotlib.pyplot relevant data in gui window save, zoom, rotate , other functionality; on cloud server error, if don't try invoke show() function: bitnami@stockpredix:/opt/bitnami/apps/django/django_projects/project$ python api-test_volume.py traceback (most recent call last): file "api-test_volume.py", line 8, in <module> import matplotlib.pyplot plt file "/opt/bitnami/python/lib/python2.7/site-packages/matplotlib/pyplot.py", line 114, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() file "/opt/bitnami/python/lib/python2.7/site-packages/matplotlib/backend...
Comments
Post a Comment