-
Notifications
You must be signed in to change notification settings - Fork 0
/
07-03-2023 DT
41 lines (29 loc) · 848 Bytes
/
07-03-2023 DT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
s=input().strip()
for i in range(1,len(s)-1):
print(int(s[:i])*int(s[i:]),end=" ")
------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv)
{
string s;
cin>>s;
for(int i=1;i<s.length();i++) {
int k = stoi(s.substr(0,i));
int l = stoi(s.substr(i,s.length()));
cout<<k*l<<" ";
}
}
----------------------------------------------------------
import java.util.*;
public class Hello {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
for(int i=1;i<s.length();i++){
int k=Integer.parseInt(s.substring(0,i));
int l=Integer.parseInt(s.substring(i,s.length()));
System.out.print(k*l+" ");
}
}
}