We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79ad325 commit 1cc4fb2Copy full SHA for 1cc4fb2
TarihFormati.java
@@ -0,0 +1,24 @@
1
+package com.company;
2
+
3
+import java.util.Scanner;
4
5
+public class TarihFormati {
6
+ public static void main(String args[]){
7
+ Scanner scanner = new Scanner(System.in);
8
+ System.out.println("Örnek Format: 26/01/2000");
9
+ System.out.print("Tarih Giriniz: ");
10
+ String tarih = scanner.nextLine();
11
+ int cizgisayi = 0;
12
+ for(int i = 0; i < tarih.length(); i++){
13
+ if(tarih.charAt(i) == '/'){
14
+ cizgisayi++;
15
+ }
16
17
+ if(cizgisayi == 2){
18
+ String[] tarihi = tarih.split("/");
19
+ System.out.println(tarihi[2]+"/"+tarihi[1]+"/"+tarihi[0]);
20
+ }else{
21
+ System.out.println("Tarih Formatı Hatalı");
22
23
24
+}
0 commit comments