我需要编写一个代码,为用户提供一个方程式,如果用户解决它,将会给出促销代码。
1,我只需要将随机数从1到9。
2,No"随机" JOptionpane中显示的数字:(!
3,我还需要一个包含多个数字(4位数字好)的随机数的促销代码。
提前致谢!
public class ZooMapFragment extends SupportMapFragment implements OnMapReadyCallback {
public static ZooMapFragment getInstance(){
ZooMapFragment fragment = new ZooMapFragment();
return fragment;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
CameraPosition position = CameraPosition.builder()
.target(new LatLng(39.7494, -104.9498))
.zoom(16f)
.bearing(0.0f)
.tilt(0.0f)
.build();
getMapAsync().animateCamera(CameraUpdateFactory.newCameraPosition( position ), null);
getMapAsync().setMapType(GoogleMap.MAP_TYPE_HYBRID);
getMapAsync().setTrafficEnabled( true );
getMapAsync().getUiSettings().setZoomControlsEnabled( true );
MarkerOptions options = new MarkerOptions().position( new LatLng( 39.7500, -104.9500 ) );
options.title( "Zoo" );
options.icon(BitmapDescriptorFactory.defaultMarker( BitmapDescriptorFactory.HUE_BLUE ) );
getMapAsync().addMarker( options );
getMapAsync().setOnMarkerClickListener( new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
marker.showInfoWindow();
return true;
}
});
RestAdapter adapter = new RestAdapter.Builder()
.setEndpoint(getString(R.string.pins_feed))
.build();
PinsApiInterface pinsApiInterface = adapter.create(PinsApiInterface.class);
pinsApiInterface.getStreams(new Callback<List<Pin>>() {
@Override
public void success(List<Pin> pins, Response response) {
for(Pin pin: pins){
Log.e("Zoo", pin.getName());
}
}
@Override
public void failure(RetrofitError error) {
}
});
}
@Override
public void onMapReady(GoogleMap googleMap) {
// Add a marker in Denver, Zoo
// and move the map's camera to the same location.
LatLng denverZoo = new LatLng(39.7500, -104.9500);
googleMap.addMarker(new MarkerOptions().position(denverZoo)
.title("Marker in Denver Zoo"));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(denverZoo));
}
}