croatia less populous than Austria
lesotho not a European country
romania European country more populous than Austria
somalia not a European country
algeria not a European country
armenia not a European country
austria A European country
B(ucharest) and V(ienna) are their capitals and Capital letters, that can be assigned to 7 and 9.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr(13) & Chr(10)
Open "country list.txt" For Input As #1
Do
Line Input #1, l$
l$ = LCase(l)
good = 1
For i = 1 To 7
ix = InStr(l, Mid(l, i, 1))
If ix <> i And (i <> 7 Or ix <> 4) Then good = 0: Exit For
Next
If Len(l) > 7 Then good = 0
If Mid(l, 4, 1) <> Right(l, 1) Then good = 0
If good Then Text1.Text = Text1.Text & l & crlf
Loop Until EOF(1)
Close 1
Text1.Text = Text1.Text & crlf
Open "country list.txt" For Input As #1
Do
Line Input #1, l$
l$ = LCase(l)
good = 1
For i = 1 To 7
ix = InStr(l, Mid(l, i, 1))
If ix <> i And (i <> 7 Or ix <> 1) Then good = 0: Exit For
Next
If Len(l) > 7 Then good = 0
If Mid(l, 1, 1) <> Right(l, 1) Then good = 0
If good Then Text1.Text = Text1.Text & l & crlf
Loop Until EOF(1)
Close 1
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2018-04-10 10:10:15 |