daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Aufgabe2 {
  2.  
  3.    
  4.     static String secToString(int k)
  5.     {
  6.         int minute = (k/60)%60;
  7.         int sekunden = k % 60;
  8.         int stunden = (k/60)/60;
  9.         String hour = String.valueOf(stunden);
  10.         String min = String.valueOf(minute);
  11.         String sek = String.valueOf(sekunden);
  12.         if(minute<10)
  13.         {
  14.         min = String.valueOf(minute);
  15.         min = "0" + min;
  16.         }
  17.         if(sekunden<10)
  18.         {
  19.          sek = String.valueOf(sekunden);
  20.         sek = "0" + sek;
  21.         }
  22.         if(stunden<10)
  23.         {
  24.         hour = String.valueOf(stunden);
  25.         hour = "0" + hour;
  26.         }
  27.         String ausgabe = hour + ":" + min +":" + sek;
  28.        
  29.         return ausgabe;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top