Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
23907 | LeoWang | digit函数 | C++ | Accepted | 0 MS | 244 KB | 238 | 2023-08-01 23:45:25 |
#include<bits/stdc++.h> using namespace std; int cnt=0,yu; void digit(int n,int k){ if(cnt==k){ cout<<yu; return; } yu=n%10; cnt++; digit(n/10,k); } int main() { int n,k; cin>>n>>k; digit(n,k); return 0; }