我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Last Digit

The number of permutation without repetition that has a string S is so big, but in this problem you just need to print the last nonzero digit of it.

Input

In each test case you have a string S (1 <= |S| <= 1000000), all characters in the string are lowercase.

Output

For each test case print the last nonzero digit.

Sample Input

aaba
aaabababababa
abbzazzazzalzalzzaaaaazlalzaazlalzla
w
Sample Output

4
7
8
1
Hints

For example for the first test case the permutation are:
aaab
aaba
abaa
baaa

https://answers.yahoo.com/question/index?qid=20110916091008AACH7vf

近期文章

  • Celebrity jeopardy
  • java 求助,SWT 的Button怎样设置颜色?java开发
  • js 下拉框赋值,是null或不存在默认第一个吗
  • 微信第三方页面授权报错
  • 惠普hp-ux锁定多于帐号
  • 百度上传插件webuploader在ie8,9下怎么用
  • htmlunit抓取数据时,遇到滚动条,抓取的页面信息不全
  • JAVA微信H5支付demo,求详细案例带注释
  • linuxc++怎么没有cuchar头文件?
  • 前台界面值传递乱码问题
  • java入门小程序,利用数组与随机函数
  • Socket断线重连读数据一直处于阻塞状态
  • 使用ajax和highchart如何实现多条折现数据的传递?
  • TCP Retransmission造成的原因?Wireshark进行的数据抓包
  • 即点即改,有些简单的问题,请大神赐教
  • Android百度地图路线规划去掉节点图标
  • 如何在windows下安装ILIAS
  • NS2 分层拓扑结构仿真
  • 数据入库实现及性能如何提升?
  • 如何更改俩条线段相交时节点的样式

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华