Problem:http://codeforces.com/contest/725/problem/A
Code:
Code:
#include<bits/stdc++.h> using namespace std; int main() { long long n,i,sum; string s; while(cin>>n>>s) { sum=0; for(i=0;i<s.length();i++) { if(s[i]=='<') sum++; else break; } for(i=s.length()-1;i>=0;i--) { if(s[i]=='>') sum++; else break; } cout<<sum<<endl; } return 0; }
No comments:
Post a Comment